Skip to content

Commit 82fa0e1

Browse files
authoredMar 8, 2024··
chore: Disable vitest globals (#52)
1 parent 5043212 commit 82fa0e1

21 files changed

+212
-328
lines changed
 

‎package.json

+9-10
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,26 @@
3737
},
3838
"namespace": "@tanstack",
3939
"devDependencies": {
40-
"@solidjs/testing-library": "^0.8.5",
40+
"@solidjs/testing-library": "^0.8.6",
4141
"@tanstack/config": "^0.6.0",
42-
"@testing-library/jest-dom": "^6.1.5",
43-
"@testing-library/react": "^14.1.2",
44-
"@testing-library/user-event": "^14.4.3",
45-
"@testing-library/vue": "^7.0.0",
42+
"@testing-library/jest-dom": "^6.4.2",
43+
"@testing-library/react": "^14.2.1",
44+
"@testing-library/user-event": "^14.5.2",
45+
"@testing-library/vue": "^8.0.2",
4646
"@types/eslint": "^8.56.2",
47-
"@types/jest": "^26.0.4",
4847
"@types/node": "^18.19.3",
4948
"@types/react": "^18.2.45",
5049
"@types/react-dom": "^18.0.5",
5150
"@typescript-eslint/eslint-plugin": "^6.21.0",
5251
"@typescript-eslint/parser": "^6.21.0",
53-
"@vitest/coverage-istanbul": "^1.2.2",
52+
"@vitest/coverage-istanbul": "^1.3.1",
5453
"eslint": "^8.56.0",
5554
"eslint-config-prettier": "^9.1.0",
5655
"eslint-import-resolver-typescript": "^3.6.1",
5756
"eslint-plugin-import": "^2.29.1",
5857
"eslint-plugin-react": "^7.33.2",
5958
"eslint-plugin-react-hooks": "^4.6.0",
60-
"jsdom": "^23.0.1",
59+
"jsdom": "^24.0.0",
6160
"knip": "^4.6.0",
6261
"nx": "^17.2.8",
6362
"prettier": "^4.0.0-alpha.8",
@@ -71,8 +70,8 @@
7170
"typescript49": "npm:typescript@4.9",
7271
"typescript50": "npm:typescript@5.0",
7372
"typescript51": "npm:typescript@5.1",
74-
"vite": "^5.1.0",
75-
"vitest": "^1.2.2",
73+
"vite": "^5.1.5",
74+
"vitest": "^1.3.1",
7675
"vue": "^3.3.4"
7776
}
7877
}

‎packages/angular-store/src/tests/index.test.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, expect, test } from 'vitest'
12
import { Component, effect } from '@angular/core'
23
import { TestBed } from '@angular/core/testing'
34
import { By } from '@angular/platform-browser'

‎packages/angular-store/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"moduleResolution": "Bundler",
54
"experimentalDecorators": true,
6-
"types": ["vitest/globals"],
5+
"moduleResolution": "Bundler",
76
"paths": {
87
"@tanstack/store": ["../store/src"]
98
}

‎packages/angular-store/tsconfig.legacy.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4+
"experimentalDecorators": true,
45
"moduleResolution": "Node",
56
"paths": {
67
"@tanstack/store": ["../store/src"]

‎packages/angular-store/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const config = defineConfig({
88
watch: false,
99
environment: 'jsdom',
1010
setupFiles: ['src/tests/test-setup.ts'],
11-
globals: true,
1211
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
1312
typecheck: { enabled: true },
13+
globals: true,
1414
},
1515
})
1616

‎packages/react-store/src/tests/index.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import { describe, expect, it, test, vi } from 'vitest'
12
import { render, waitFor } from '@testing-library/react'
2-
import '@testing-library/jest-dom'
33
import * as React from 'react'
44
import { Store } from '@tanstack/store'
55
import { useState } from 'react'
6-
import userEvent from '@testing-library/user-event'
6+
import { userEvent } from '@testing-library/user-event'
77
import { shallow, useStore } from '../index'
88

99
const user = userEvent.setup()

‎packages/react-store/test-setup.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import '@testing-library/jest-dom/vitest'
2+
import { cleanup } from '@testing-library/react'
3+
import { afterEach } from 'vitest'
4+
5+
// https://testing-library.com/docs/react-testing-library/api#cleanup
6+
afterEach(() => cleanup())

‎packages/react-store/tsconfig.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
"compilerOptions": {
44
"jsx": "react",
55
"moduleResolution": "Bundler",
6-
"types": ["vitest/globals"],
76
"paths": {
87
"@tanstack/store": ["../store/src"]
98
}
109
},
11-
"include": ["src/**/*.ts", "src/**/*.tsx", ".eslintrc.cjs", "vite.config.ts"]
10+
"include": [
11+
"src/**/*.ts",
12+
"src/**/*.tsx",
13+
".eslintrc.cjs",
14+
"test-setup.ts",
15+
"vite.config.ts"
16+
]
1217
}

‎packages/react-store/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const config = defineConfig({
99
dir: './src',
1010
watch: false,
1111
environment: 'jsdom',
12-
globals: true,
12+
setupFiles: ['test-setup.ts'],
1313
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
1414
typecheck: { enabled: true },
1515
},

‎packages/solid-store/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@
6161
},
6262
"devDependencies": {
6363
"solid-js": "^1.7.8",
64-
"vite-plugin-solid": "^2.8.0"
64+
"vite-plugin-solid": "^2.10.1"
6565
}
6666
}

‎packages/solid-store/src/tests/index.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { describe, expect, it } from 'vitest'
12
import { render, renderHook } from '@solidjs/testing-library'
2-
import '@testing-library/jest-dom'
33
import { Store } from '@tanstack/store'
44
import { useStore } from '../index'
55

‎packages/solid-store/test-setup.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import '@testing-library/jest-dom/vitest'
2+
import { cleanup } from '@solidjs/testing-library'
3+
import { afterEach } from 'vitest'
4+
5+
// https://github.com/solidjs/solid-testing-library
6+
afterEach(() => cleanup())

‎packages/solid-store/tsconfig.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
"jsx": "preserve",
55
"jsxImportSource": "solid-js",
66
"moduleResolution": "Bundler",
7-
"types": ["vitest/globals"],
87
"paths": {
98
"@tanstack/store": ["../store/src"]
109
}
1110
},
12-
"include": ["src/**/*.ts", "src/**/*.tsx", ".eslintrc.cjs", "vite.config.ts"]
11+
"include": [
12+
"src/**/*.ts",
13+
"src/**/*.tsx",
14+
".eslintrc.cjs",
15+
"test-setup.ts",
16+
"vite.config.ts"
17+
]
1318
}

‎packages/solid-store/vite.config.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,10 @@ const config = defineConfig({
88
name: 'solid-store',
99
dir: './src',
1010
watch: false,
11-
setupFiles: [],
1211
environment: 'jsdom',
13-
globals: true,
12+
setupFiles: ['test-setup.ts'],
1413
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
1514
typecheck: { enabled: true },
16-
server: {
17-
deps: {
18-
// https://github.com/solidjs/solid-testing-library#known-issues
19-
inline: [/solid-js/],
20-
},
21-
},
2215
},
2316
})
2417

‎packages/store/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"moduleResolution": "Bundler",
5-
"types": ["vitest/globals"]
4+
"moduleResolution": "Bundler"
65
},
76
"include": ["src/**/*.ts", "src/**/*.tsx", ".eslintrc.cjs", "vite.config.ts"]
87
}

‎packages/store/vite.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const config = defineConfig({
77
dir: './src',
88
watch: false,
99
environment: 'jsdom',
10-
globals: true,
1110
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
1211
typecheck: { enabled: true },
1312
},

‎packages/vue-store/src/tests/index.test.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// We need to import `h` as it's part of Vue's JSX transform
2-
// @ts-expect-error
1+
import { describe, expect, it, test, vi } from 'vitest'
2+
// @ts-expect-error We need to import `h` as it's part of Vue's JSX transform
33
import { defineComponent, h } from 'vue-demi'
44
import { render, waitFor } from '@testing-library/vue'
5-
import '@testing-library/jest-dom'
65
import { Store } from '@tanstack/store'
7-
import userEvent from '@testing-library/user-event'
6+
import { userEvent } from '@testing-library/user-event'
87
import { shallow, useStore } from '../index'
98

109
const user = userEvent.setup()

‎packages/vue-store/test-setup.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import '@testing-library/jest-dom/vitest'
2+
import { cleanup } from '@testing-library/vue'
3+
import { afterEach } from 'vitest'
4+
5+
// https://testing-library.com/docs/vue-testing-library/api#cleanup
6+
afterEach(() => cleanup())

‎packages/vue-store/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"jsx": "preserve",
55
"jsxImportSource": "vue",
66
"moduleResolution": "Bundler",
7-
"types": ["vitest/globals", "vue/jsx"],
7+
"types": ["vue/jsx"],
88
"paths": {
99
"@tanstack/store": ["../store/src"]
1010
}

‎packages/vue-store/vite.config.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ const config = defineConfig({
99
dir: './src',
1010
watch: false,
1111
environment: 'jsdom',
12-
globals: true,
13-
setupFiles: [],
12+
setupFiles: ['test-setup.ts'],
1413
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
1514
typecheck: { enabled: true },
1615
},

‎pnpm-lock.yaml

+155-288
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.