From b75bc51a8d2cbfa0300e5c9fc5f0d839dea24ef2 Mon Sep 17 00:00:00 2001 From: AlexisG Date: Mon, 23 Dec 2024 11:00:18 +0100 Subject: [PATCH] feat(cozy-sharing): Replace jsdom-sixteen package --- packages/cozy-sharing/jest.config.js | 10 ++++++++-- packages/cozy-sharing/package.json | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/cozy-sharing/jest.config.js b/packages/cozy-sharing/jest.config.js index 08e49f5089..b55412ac19 100644 --- a/packages/cozy-sharing/jest.config.js +++ b/packages/cozy-sharing/jest.config.js @@ -5,7 +5,11 @@ module.exports = { '!**/vendor/**', '!**/*.stories.{js,jsx,ts,tsx}' ], - testPathIgnorePatterns: ['node_modules', 'dist', '__tests__'], + testPathIgnorePatterns: [ + '/node_modules/', + '/dist/', + '/__tests__/' + ], roots: ['/src'], testURL: 'http://localhost/', moduleFileExtensions: ['js', 'jsx', 'json', 'styl'], @@ -18,6 +22,8 @@ module.exports = { '^cozy-logger$': 'cozy-logger/dist/index.js', '^cozy-client$': 'cozy-client/dist/index.js' }, - transformIgnorePatterns: ['node_modules/(?!cozy-ui)'], + transformIgnorePatterns: [ + '/node_modules/(?!(cozy-ui|cozy-harvest-lib))' + ], setupFilesAfterEnv: ['/jestHelpers/setup.js'] } diff --git a/packages/cozy-sharing/package.json b/packages/cozy-sharing/package.json index 6deaf7ed91..3f8a5aa05f 100644 --- a/packages/cozy-sharing/package.json +++ b/packages/cozy-sharing/package.json @@ -19,7 +19,7 @@ "build:doc:react": "(cd ../.. && TARGET=cozy-sharing yarn build:doc:react)", "deploy:doc": "(cd ../.. && yarn deploy:doc)", "prepublishOnly": "yarn build", - "test": "env NODE_ENV=test jest --env=jest-environment-jsdom-sixteen", + "test": "env NODE_ENV=test jest", "lint": "cd .. && yarn eslint --ext js,jsx packages/cozy-sharing", "start": "yarn build --watch", "watch": "yarn run start", @@ -55,6 +55,7 @@ "cozy-client": "^51.6.1", "cozy-ui": "^115.0.2", "jest": "26.6.3", + "jest-environment-jsdom": "26.6.2", "react": "16.12.0", "react-dom": "16.13.0", "react-router": "^5.0.1",