Skip to content

Commit

Permalink
test: Fix test env after updates
Browse files Browse the repository at this point in the history
- Add preset because CI fails to read it from the dependency
- Fix a test
- Fix a jest transformIgnorePattern
  • Loading branch information
acezard committed Oct 23, 2023
1 parent 120bff4 commit f832b7f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ['cozy-app']
presets: ['cozy-app', '@babel/env']
}
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module.exports = {
'^.+\\.webapp$': '<rootDir>/test/jestLib/json-transformer.js'
},
transformIgnorePatterns: [
'node_modules/(?!cozy-ui|cozy-harvest-lib|cozy-keys-lib|cozy-sharing|)'
'node_modules/(?!cozy-ui|cozy-harvest-lib|cozy-keys-lib|cozy-sharing|)',
'jest-runner'
],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
Expand Down
4 changes: 2 additions & 2 deletions src/drive/web/modules/viewer/CallToAction.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ describe('CallToAction', () => {
expect(localforage.getItem).toHaveBeenCalledWith(NOVIEWER_DESKTOP_CTA)
})

it('should use rel="noreferrer" (which implies rel="noopener", because it is a security risk', async done => {
it('should use rel="noreferrer" (which implies rel="noopener", because it is a security risk', done => {
// Given
localforage.getItem = jest.fn().mockResolvedValueOnce(false)

// When
const { container } = await render(<CallToAction t={jest.fn()} />)
const { container } = render(<CallToAction t={jest.fn()} />)

// Then
setTimeout(() => {
Expand Down
25 changes: 5 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7784,7 +7784,7 @@ babel-preset-jest@^29.6.3:
babel-runtime@6.26.0, babel-runtime@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4=
integrity sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==
dependencies:
core-js "^2.4.0"
regenerator-runtime "^0.11.0"
Expand Down Expand Up @@ -8666,25 +8666,10 @@ camelcase@^6.0.0, camelcase@^6.2.0:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==

caniuse-lite@^1.0.30001039, caniuse-lite@^1.0.30001135:
version "1.0.30001292"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001292.tgz#4a55f61c06abc9595965cfd77897dc7bc1cdc456"
integrity sha512-jnT4Tq0Q4ma+6nncYQVe7d73kmDmE9C3OGTx3MvW7lBM/eY1S1DZTMBON7dqV481RhNiS5OxD7k9JQvmDOTirw==

caniuse-lite@^1.0.30001286:
version "1.0.30001305"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001305.tgz#02cd8031df07c4fcb117aa2ecc4899122681bd4c"
integrity sha512-p7d9YQMji8haf0f+5rbcv9WlQ+N5jMPfRAnUmZRlNxsNeBO3Yr7RYG6M2uTY1h9tCVdlkJg6YNNc4kiAiBLdWA==

caniuse-lite@^1.0.30001517:
version "1.0.30001522"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001522.tgz#44b87a406c901269adcdb834713e23582dd71856"
integrity sha512-TKiyTVZxJGhsTszLuzb+6vUZSjVOAhClszBr2Ta2k9IwtNBT/4dzmL6aywt0HCgEZlmwJzXJd8yNiob6HgwTRg==

caniuse-lite@^1.0.30001541:
version "1.0.30001541"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz#b1aef0fadd87fb72db4dcb55d220eae17b81cdb1"
integrity sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==
caniuse-lite@^1.0.30001039, caniuse-lite@^1.0.30001135, caniuse-lite@^1.0.30001286, caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001541:
version "1.0.30001553"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001553.tgz"
integrity sha512-N0ttd6TrFfuqKNi+pMgWJTb9qrdJu4JSpgPFLe/lrD19ugC6fZgF0pUewRowDwzdDnb9V41mFcdlYgl/PyKf4A==

capture-exit@^2.0.0:
version "2.0.0"
Expand Down

0 comments on commit f832b7f

Please sign in to comment.