Skip to content

Commit 8864e56

Browse files
timfishAbhiPrasad
authored andcommitted
chore(jest): Final Jest cleanup
1 parent 12c5e73 commit 8864e56

File tree

23 files changed

+15
-87
lines changed

23 files changed

+15
-87
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = {
3838
},
3939
},
4040
{
41-
files: ['jest/**/*.ts', 'scripts/**/*.ts'],
41+
files: ['scripts/**/*.ts'],
4242
parserOptions: {
4343
project: ['tsconfig.dev.json'],
4444
},

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ scratch/
1717
# side effects of running AWS lambda layer zip action locally
1818
dist-serverless/
1919
sentry-node-serverless-*.zip
20-
# transpiled transformers
21-
jest/transformers/*.js
2220
# node tarballs
2321
packages/*/sentry-*.tgz
2422
.nxcache

dev-packages/node-integration-tests/.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = {
22
env: {
33
node: true,
4-
jest: true,
54
},
65
extends: ['../../.eslintrc.js'],
76
overrides: [

dev-packages/node-integration-tests/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ folders containing test scenarios and assertions.
2323
`runServer` also accepts an optional `scenarioPath` argument for non-standard usage.
2424

2525
`test.ts` is required for each test case, and contains the server runner logic, request interceptors for Sentry
26-
requests, and assertions. Test server, interceptors and assertions are all run on the same Jest thread.
26+
requests, and assertions. Test server, interceptors and assertions are all run on the same Vitest thread.
2727

2828
### Utilities
2929

@@ -40,12 +40,10 @@ Tests can be run locally with:
4040

4141
`yarn test`
4242

43-
To run tests with Jest's watch mode:
43+
To run tests with Vitest's watch mode:
4444

4545
`yarn test:watch`
4646

4747
To filter tests by their title:
4848

4949
`yarn test -t "set different properties of a scope"`
50-
51-
You can refer to [Jest documentation](https://jestjs.io/docs/cli) for other CLI options.

dev-packages/node-integration-tests/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"lib": ["DOM", "ES2018"],
1010
// package-specific options
1111
"esModuleInterop": true,
12-
"types": ["node", "jest"]
12+
"types": ["node"]
1313
}
1414
}

jest/jest.config.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"circularDepCheck": "lerna run circularDepCheck",
1616
"clean": "run-s clean:build clean:caches",
1717
"clean:build": "lerna run clean",
18-
"clean:caches": "yarn rimraf eslintcache .nxcache .nx && yarn jest --clearCache",
18+
"clean:caches": "yarn rimraf eslintcache .nxcache .nx",
1919
"clean:deps": "lerna clean --yes && rm -rf node_modules && yarn",
2020
"clean:tarballs": "rimraf {packages,dev-packages}/*/*.tgz",
2121
"clean:watchman": "watchman watch-del \".\"",
@@ -110,17 +110,13 @@
110110
"@rollup/pluginutils": "^5.1.0",
111111
"@size-limit/file": "~11.1.6",
112112
"@size-limit/webpack": "~11.1.6",
113-
"@types/jest": "^27.4.1",
114113
"@types/jsdom": "^21.1.6",
115114
"@types/node": "^18.19.1",
116115
"@vitest/coverage-v8": "^2.1.8",
117116
"deepmerge": "^4.2.2",
118117
"downlevel-dts": "~0.11.0",
119118
"es-check": "^7.2.1",
120119
"eslint": "7.32.0",
121-
"jest": "^27.5.1",
122-
"jest-environment-node": "^27.5.1",
123-
"jest-junit": "^16.0.0",
124120
"jsdom": "^21.1.2",
125121
"lerna": "7.1.1",
126122
"madge": "7.0.0",
@@ -133,7 +129,6 @@
133129
"rollup-plugin-license": "^3.3.1",
134130
"size-limit": "~11.1.6",
135131
"sucrase": "^3.35.0",
136-
"ts-jest": "^27.1.4",
137132
"ts-node": "10.9.1",
138133
"typescript": "~5.0.0",
139134
"vitest": "^2.1.8",

packages/core/test/utils-hoist/misc.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,6 @@ describe('checkOrSetAlreadyCaught()', () => {
291291

292292
describe('uuid4 generation', () => {
293293
const uuid4Regex = /^[0-9A-F]{12}[4][0-9A-F]{3}[89AB][0-9A-F]{15}$/i;
294-
// Jest messes with the global object, so there is no global crypto object in any node version
295-
// For this reason we need to create our own crypto object for each test to cover all the code paths
296294
it('returns valid uuid v4 ids via Math.random', () => {
297295
for (let index = 0; index < 1_000; index++) {
298296
expect(uuid4()).toMatch(uuid4Regex);

packages/core/test/utils-hoist/object.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @jest-environment jsdom
2+
* @vitest-environment jsdom
33
*/
44

55
import type { WrappedFunction } from '../../src/types-hoist';
@@ -331,17 +331,10 @@ describe('objectify()', () => {
331331
});
332332

333333
describe('wraps other primitives with their respective object wrapper classes', () => {
334-
// TODO: There's currently a bug in Jest - if you give it the `Boolean` class, it runs `typeof received ===
335-
// 'boolean'` but not `received instanceof Boolean` (the way it correctly does for other primitive wrappers, like
336-
// `Number` and `String). (See https://github.com/facebook/jest/pull/11976.) Once that is fixed and we upgrade jest,
337-
// we can comment the test below back in. (The tests for symbols and bigints are working only because our current
338-
// version of jest is sufficiently old that they're not even considered in the relevant check and just fall to the
339-
// default `instanceof` check jest uses for all unknown classes.)
340-
341334
it.each([
342335
['number', Number, 1121],
343336
['string', String, 'Dogs are great!'],
344-
// ["boolean", Boolean, true],
337+
['boolean', Boolean, true],
345338
['symbol', Symbol, Symbol('Maisey')],
346339
])('%s', (_caseName, wrapperClass, primitive) => {
347340
const objectifiedPrimitive = objectify(primitive);

packages/eslint-config-sdk/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"eslint-config-prettier": "^6.11.0",
3030
"eslint-plugin-deprecation": "^1.5.0",
3131
"eslint-plugin-import": "^2.22.0",
32-
"eslint-plugin-jest": "^27.2.2",
3332
"eslint-plugin-jsdoc": "^30.0.3",
3433
"eslint-plugin-simple-import-sort": "^5.0.3"
3534
},

packages/eslint-config-sdk/src/base.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,6 @@ module.exports = {
154154
},
155155
},
156156
{
157-
// Configuration for files in test directories
158-
env: {
159-
jest: true,
160-
},
161157
files: [
162158
'test.ts',
163159
'*.test.ts',

packages/gatsby/tsconfig.plugin.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
"compilerOptions": {
77
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8-
// "types": ["node", "jest"]
98
"declaration": true,
109
"declarationMap": false,
1110
"emitDeclarationOnly": true,

packages/node/jest.config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/node/test/helpers/conditional.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const NODE_VERSION = parseSemver(process.versions.node).major;
77
* Returns`describe` or `describe.skip` depending on allowed major versions of Node.
88
*
99
* @param {{ min?: number; max?: number }} allowedVersion
10-
* @return {*} {jest.Describe}
1110
*/
1211
export const conditionalTest = (allowedVersion: { min?: number; max?: number }) => {
1312
if (!NODE_VERSION) {

packages/nuxt/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
"compilerOptions": {
77
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8-
"types": ["node", "vitest/globals"]
8+
"types": ["node"]
99
}
1010
}

packages/react-router/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"include": ["test/**/*", "vite.config.ts"],
55

66
"compilerOptions": {
7-
"types": ["node", "vitest/globals"],
7+
"types": ["node"],
88
}
99
}

packages/remix/test/integration/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"include": ["test/**/*"],
55

66
"compilerOptions": {
7-
"types": ["node", "vitest/globals"]
7+
"types": ["node"]
88
}
99
}

packages/solid/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"devDependencies": {
6060
"@solidjs/router": "^0.13.4",
6161
"@solidjs/testing-library": "0.8.5",
62-
"@testing-library/jest-dom": "^6.4.5",
6362
"@testing-library/user-event": "^14.5.2",
6463
"solid-js": "^1.8.11",
6564
"vite-plugin-solid": "^2.8.2"

packages/solid/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"compilerOptions": {
77
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8-
"types": ["vite/client", "@testing-library/jest-dom"],
8+
"types": ["vite/client"],
99

1010
// other package-specific, test-specific options
1111
"jsx": "preserve",

packages/solidstart/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"@solidjs/router": "^0.13.4",
7777
"@solidjs/start": "^1.0.0",
7878
"@solidjs/testing-library": "0.8.5",
79-
"@testing-library/jest-dom": "^6.4.5",
8079
"@testing-library/user-event": "^14.5.2",
8180
"vite-plugin-solid": "^2.8.2"
8281
},

packages/solidstart/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"compilerOptions": {
77
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8-
"types": ["node", "vitest/globals", "vite/client", "@testing-library/jest-dom"],
8+
"types": ["node",],
99

1010
// other package-specific, test-specific options
1111
"jsx": "preserve",

tsconfig-templates/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"compilerOptions": {
77
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8-
"types": ["jest"]
8+
"types": []
99

1010
// other package-specific, test-specific options
1111
}

tsconfig.dev.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
{
33
"extends": "./tsconfig.json",
44

5-
"include": ["**/scripts/**/*.ts", "jest/**/*.ts", "vite/**/*.ts"],
5+
"include": ["**/scripts/**/*.ts", "vite/**/*.ts"],
66

77
"compilerOptions": {
8-
"types": ["node", "jest", "vitest/globals"]
8+
"types": ["node"]
99
}
1010
}

0 commit comments

Comments
 (0)