From a34322f8be694eef48db639129fba0393c4a31c4 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 | 11 +++-------- packages/cozy-sharing/package.json | 3 ++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/cozy-sharing/jest.config.js b/packages/cozy-sharing/jest.config.js index 08e49f5089..f74991d188 100644 --- a/packages/cozy-sharing/jest.config.js +++ b/packages/cozy-sharing/jest.config.js @@ -1,14 +1,9 @@ module.exports = { - collectCoverageFrom: [ - 'src/**/*.{js,jsx}', - '!**/node_modules/**', - '!**/vendor/**', - '!**/*.stories.{js,jsx,ts,tsx}' - ], testPathIgnorePatterns: ['node_modules', 'dist', '__tests__'], + testEnvironment: 'jest-environment-jsdom', roots: ['/src'], testURL: 'http://localhost/', - moduleFileExtensions: ['js', 'jsx', 'json', 'styl'], + moduleFileExtensions: ['js', 'jsx', 'json', 'styl', 'ts', 'tsx'], moduleDirectories: ['src', 'node_modules'], moduleNameMapper: { '.(png|gif|jpe?g)$': '/jestHelpers/mocks/fileMock.js', @@ -18,6 +13,6 @@ 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",