diff --git a/packages/g6-extension-3d/jest.config.js b/packages/g6-extension-3d/jest.config.js index 27d57b860cd..50dd771b933 100644 --- a/packages/g6-extension-3d/jest.config.js +++ b/packages/g6-extension-3d/jest.config.js @@ -5,4 +5,5 @@ module.exports = { testRegex: '(/__tests__/.*\\.(test|spec))\\.(ts|tsx|js)$', collectCoverageFrom: ['src/**/*.ts'], moduleFileExtensions: ['ts', 'js', 'json'], + transformIgnorePatterns: [`/node_modules/.pnpm/(?!(d3-*))`], }; diff --git a/packages/g6/jest.config.js b/packages/g6/jest.config.js index bbb08b509f8..409259a2206 100644 --- a/packages/g6/jest.config.js +++ b/packages/g6/jest.config.js @@ -13,10 +13,9 @@ module.exports = { collectCoverageFrom: ['src/**/*.ts'], coveragePathIgnorePatterns: ['/src/elements/nodes/html.ts'], moduleFileExtensions: ['ts', 'tsx', 'js', 'json'], - collectCoverage: false, + collectCoverage: true, testRegex: '(/__tests__/.*\\.(test|spec))\\.(ts|tsx|js)$', - // Transform esm to cjs. - transformIgnorePatterns: [`/node_modules/(?!(${esm}))`, `/node_modules/.pnpm/(?!(${esm}))`], + transformIgnorePatterns: [`/node_modules/.pnpm/(?!(${esm}))`], testPathIgnorePatterns: ['/(lib|esm)/__tests__/'], moduleNameMapper: { '^@@/(.*)$': '/__tests__/$1', diff --git a/packages/g6/package.json b/packages/g6/package.json index 1daa44f6470..533ddcfc1e8 100644 --- a/packages/g6/package.json +++ b/packages/g6/package.json @@ -42,14 +42,13 @@ "coverage:open": "open coverage/lcov-report/index.html", "dev": "vite", "fix": "eslint ./src ./__tests__ --fix && prettier ./src __tests__ --write ", - "jest": "node --expose-gc --max-old-space-size=1024 --unhandled-rejections=strict --experimental-vm-modules ../../node_modules/jest/bin/jest --coverage --logHeapUsage --detectOpenHandles", - "jest:inspect": "node --inspect --expose-gc --max-old-space-size=1024 --unhandled-rejections=strict --experimental-vm-modules ../../node_modules/jest/bin/jest --coverage --logHeapUsage --detectOpenHandles --runInBand", + "jest": "node --expose-gc --max-old-space-size=1024 --unhandled-rejections=strict ../../node_modules/jest/bin/jest --coverage --logHeapUsage --detectOpenHandles", "lint": "eslint ./src __tests__ --quiet && prettier ./src __tests__ --check", "prepublishOnly": "npm run ci", "size": "limit-size", "start": "rimraf ./lib && tsc --module commonjs --outDir lib --watch", "tag": "node ./scripts/tag.mjs", - "test": "npm run jest __tests__", + "test": "jest", "test:integration": "npm run jest __tests__/integration", "test:unit": "npm run jest __tests__/unit", "type-check": "tsc --noEmit"