Skip to content

Commit

Permalink
fix: fix jest config (#5786)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarebecca committed May 29, 2024
1 parent ac0490f commit 320c063
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/g6-extension-3d/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ module.exports = {
testRegex: '(/__tests__/.*\\.(test|spec))\\.(ts|tsx|js)$',
collectCoverageFrom: ['src/**/*.ts'],
moduleFileExtensions: ['ts', 'js', 'json'],
transformIgnorePatterns: [`<rootDir>/node_modules/.pnpm/(?!(d3-*))`],
};
5 changes: 2 additions & 3 deletions packages/g6/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ module.exports = {
collectCoverageFrom: ['src/**/*.ts'],
coveragePathIgnorePatterns: ['<rootDir>/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: [`<rootDir>/node_modules/(?!(${esm}))`, `<rootDir>/node_modules/.pnpm/(?!(${esm}))`],
transformIgnorePatterns: [`<rootDir>/node_modules/.pnpm/(?!(${esm}))`],
testPathIgnorePatterns: ['/(lib|esm)/__tests__/'],
moduleNameMapper: {
'^@@/(.*)$': '<rootDir>/__tests__/$1',
Expand Down
5 changes: 2 additions & 3 deletions packages/g6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 320c063

Please sign in to comment.