Skip to content

Commit

Permalink
test(examples): replace globals.d.ts with @types/jest for projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl committed Jul 10, 2024
1 parent 2f5cc0c commit 54b374a
Show file tree
Hide file tree
Showing 24 changed files with 169 additions and 123 deletions.
18 changes: 0 additions & 18 deletions examples/js-with-babel/globals.d.ts

This file was deleted.

49 changes: 35 additions & 14 deletions examples/js-with-babel/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion examples/js-with-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
"test": "jest -c=jest.config.cjs --no-cache",
"test-isolated": "jest -c=jest-isolated.config.cjs --no-cache",
"test-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm.config.mjs --no-cache",
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache"
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache",
"tsc": "tsc --noEmit -p tsconfig-esm.json"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@types/jest": "^29.5.12",
"babel-jest": "^29.7.0",
"jest": "^29.7.0",
"ts-jest": "^29.2.0",
Expand Down
3 changes: 2 additions & 1 deletion examples/js-with-babel/tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext"
"module": "ESNext",
"esModuleInterop": true
}
}
9 changes: 5 additions & 4 deletions examples/js-with-babel/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"compilerOptions": {
"module": "CommonJS",
"target": "ES2015",
"allowJs": true
},
"files": ["globals.d.ts"]
"target": "ESNext",
"allowJs": true,
"types": ["jest"],
"skipLibCheck": true
}
}
18 changes: 0 additions & 18 deletions examples/js-with-ts/globals.d.ts

This file was deleted.

21 changes: 21 additions & 0 deletions examples/js-with-ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/js-with-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"ts-jest": "^29.2.0",
"typescript": "~5.5.3"
Expand Down
2 changes: 2 additions & 0 deletions examples/js-with-ts/src/welcome-message.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { test, expect } from '@jest/globals'

import { getWelcomeMessage } from './welcome-message'
import welcomePerson from './welcome-person'

Expand Down
9 changes: 5 additions & 4 deletions examples/js-with-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"compilerOptions": {
"module": "CommonJS",
"target": "ES2015",
"allowJs": true
},
"files": ["globals.d.ts"]
"target": "ESNext",
"allowJs": true,
"skipLibCheck": true,
"types": ["jest"]
}
}
49 changes: 35 additions & 14 deletions examples/monorepo-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/monorepo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"test-esm-isolated": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-esm-isolated.config.mjs --no-cache"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"jest": "^29.7.0",
"ts-jest": "^29.2.0",
"typescript": "~5.5.3"
Expand Down
2 changes: 0 additions & 2 deletions examples/monorepo-app/tests/project-1/welcome-message.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { test, expect } from '@jest/globals'

import { getWelcomeMessage } from '../../src/welcome-message'

test('should show welcome message', () => {
Expand Down
2 changes: 0 additions & 2 deletions examples/monorepo-app/tests/project-2/welcome-message.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { test, expect } from '@jest/globals'

import { getWelcomeMessage } from '../../src/welcome-message'

test('should show welcome message', () => {
Expand Down
5 changes: 3 additions & 2 deletions examples/monorepo-app/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"skipLibCheck": true,
"target": "ESNext",
"module": "CommonJS",
"lib": ["ESNext", "dom"]
"lib": ["ESNext", "dom"],
"types": ["jest"]
}
}
5 changes: 4 additions & 1 deletion examples/react-app/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "Node"
"target": "ESNext",
"moduleResolution": "Node10",
"skipLibCheck": true,
"types": ["jest"]
}
}
Loading

0 comments on commit 54b374a

Please sign in to comment.