-
Notifications
You must be signed in to change notification settings - Fork 3.3k
chore: vitest project config #32447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: vitest project config #32447
Changes from all commits
e1feeb3
055910e
565911f
88cf57b
f7d1198
d7bce24
c8b0993
abc1add
d33fdcf
a8fac8f
aeb9bc6
281c04b
6783c69
6053a8c
28a2c0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
import { baseConfig } from '@packages/eslint-config' | ||
import { baseConfig, cliOverrides } from '@packages/eslint-config' | ||
import { globalIgnores } from 'eslint/config' | ||
|
||
export default [ | ||
// these are configured to build in place, rather than in a separate | ||
// dist folder, so we need to ignore them | ||
globalIgnores(['src/**/*.{js,js.map,d.ts}']), | ||
...baseConfig, | ||
...cliOverrides, | ||
{ | ||
files: ['**/*.spec.ts', '**/*.component.ts'], | ||
languageOptions: { | ||
parserOptions: { | ||
projectService: false, | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}, | ||
}, | ||
{ | ||
rules: { | ||
'no-console': 'off', | ||
}, | ||
}, | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"noEmit": false | ||
}, | ||
"exclude": ["src/**/files-core/**/*", "src/**/files-ct/**/*", "src/**/*.spec.ts"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
include: ['src/**/*.spec.ts'], | ||
globals: true, | ||
environment: 'node', | ||
}, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"compilerOptions": { | ||
"resolveJsonModule": true, | ||
"target": "ES2020", | ||
"module": "node16", | ||
"moduleResolution": "node16", | ||
"lib": [ | ||
"es2015", | ||
"dom" | ||
], | ||
"declaration": true, | ||
"outDir": "dist", | ||
"importHelpers": true, | ||
"strict": true, | ||
"types": [ | ||
"cypress" | ||
], | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"stripInternal": true, | ||
"ignoreDeprecations": "5.0", | ||
"importsNotUsedAsValues": "error", | ||
"skipLibCheck": true | ||
}, | ||
"include": [ | ||
"src" | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
"*.js" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,4 @@ | ||
{ | ||
"compilerOptions": { | ||
/* Basic Options */ | ||
"resolveJsonModule": true, | ||
"target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */, | ||
"module": "node16" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, | ||
"moduleResolution": "node16", | ||
"lib": [ | ||
"es2015", | ||
"dom" | ||
] /* Specify library files to be included in the compilation: */, | ||
// "checkJs": true, /* Report errors in .js files. */ | ||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ | ||
"declaration": true /* Generates corresponding '.d.ts' file. */, | ||
// "sourceMap": true, /* Generates corresponding '.map' file. */ | ||
// "outFile": "./", /* Concatenate and emit output to single file. */ | ||
"outDir": "dist" /* Redirect output structure to the directory. */, | ||
// "rootDir": "src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ | ||
// "removeComments": true, /* Do not emit comments to output. */ | ||
// "noEmit": true, /* Do not emit outputs. */ | ||
"importHelpers": true, /* Import emit helpers from 'tslib'. */ | ||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ | ||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ | ||
|
||
/* Strict Type-Checking Options */ | ||
"strict": true /* Enable all strict type-checking options. */, | ||
// "noImplicitAny": true, | ||
|
||
/* Module Resolution Options */ | ||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ | ||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ | ||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ | ||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ | ||
// "typeRoots": [], /* List of folders to include type definitions from. */ | ||
"types": ["cypress"] /* Type declaration files to be included in compilation. */, | ||
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, | ||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ | ||
|
||
/* Source Map Options */ | ||
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ | ||
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ | ||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ | ||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ | ||
|
||
/* Experimental Options */ | ||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ | ||
"esModuleInterop": true, | ||
/** Allows us to strip internal types sourced from webpack */ | ||
"stripInternal": true, | ||
"ignoreDeprecations": "5.0", | ||
/* | ||
* TODO: remove importsNotUsedAsValues after typescript 5.5 and up as it will no longer work. If we want the same behavior | ||
* as importsNotUsedAsValues, we need to use "verbatimModuleSyntax", which will require this package to be an ES Module. | ||
*/ | ||
"importsNotUsedAsValues": "error", | ||
/* skips checking declaration types. we skip this because we have multiple versions of vite installed as dev dependencies */ | ||
"skipLibCheck": true, | ||
}, | ||
"include": ["src"], | ||
"exclude": ["node_modules", "*.js"] | ||
} | ||
"extends": "./tsconfig.build.json", | ||
"include": ["src", "test"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
include: ['test/**/*.spec.ts'], | ||
globals: true, | ||
environment: 'node', | ||
}, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
include: ['test/**/*.spec.ts'], | ||
globals: true, | ||
environment: 'node', | ||
}, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
projects: [ | ||
'{packages,tooling,scripts}/*/vitest.config.{ts,mjs}', | ||
'cli/vitest.config.*', | ||
], | ||
exclude: ['**/node_modules/**', '**/dist/**', 'system-tests/**'], | ||
coverage: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where exactly does the coverage get output to and do we need to check if they are generated similar to our current CI process? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They aren't, yet! I've been using it personally to check coverage locally, but not anything in CI. |
||
provider: 'v8', | ||
reporter: ['clover'], | ||
}, | ||
reporters: ['default', 'junit'], | ||
}, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4892,10 +4892,10 @@ | |
"@jridgewell/gen-mapping" "^0.3.0" | ||
"@jridgewell/trace-mapping" "^0.3.9" | ||
|
||
"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15", "@jridgewell/sourcemap-codec@^1.5.0": | ||
version "1.5.0" | ||
resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" | ||
integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== | ||
"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15", "@jridgewell/sourcemap-codec@^1.5.0", "@jridgewell/sourcemap-codec@^1.5.5": | ||
version "1.5.5" | ||
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" | ||
integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== | ||
|
||
"@jridgewell/[email protected]": | ||
version "0.3.9" | ||
|
@@ -9055,7 +9055,7 @@ | |
dependencies: | ||
"@rolldown/pluginutils" "1.0.0-beta.19" | ||
|
||
"@vitest/coverage-v8@^3.0.9": | ||
"@vitest/coverage-v8@^3.2.4": | ||
version "3.2.4" | ||
resolved "https://registry.yarnpkg.com/@vitest/coverage-v8/-/coverage-v8-3.2.4.tgz#a2d8d040288c1956a1c7d0a0e2cdcfc7a3319f13" | ||
integrity sha512-EyF9SXU6kS5Ku/U82E259WSnvg6c8KTjppUncuNdm5QHpe17mwREHnjDzozC8x9MZ0xfBUFSaLkRv4TMA75ALQ== | ||
|
@@ -12083,9 +12083,9 @@ [email protected], chai@^4.2.0, chai@^4.3.6: | |
type-detect "^4.1.0" | ||
|
||
chai@^5.1.2, chai@^5.2.0: | ||
version "5.2.1" | ||
resolved "https://registry.yarnpkg.com/chai/-/chai-5.2.1.tgz#a9502462bdc79cf90b4a0953537a9908aa638b47" | ||
integrity sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A== | ||
version "5.3.3" | ||
resolved "https://registry.yarnpkg.com/chai/-/chai-5.3.3.tgz#dd3da955e270916a4bd3f625f4b919996ada7e06" | ||
integrity sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw== | ||
dependencies: | ||
assertion-error "^2.0.1" | ||
check-error "^2.1.1" | ||
|
@@ -21999,9 +21999,9 @@ loupe@^2.3.6: | |
get-func-name "^2.0.1" | ||
|
||
loupe@^3.1.0, loupe@^3.1.2, loupe@^3.1.4: | ||
version "3.2.0" | ||
resolved "https://registry.yarnpkg.com/loupe/-/loupe-3.2.0.tgz#174073ba8e0a1d0d5e43cc08626ed8a19403c344" | ||
integrity sha512-2NCfZcT5VGVNX9mSZIxLRkEAegDGBpuQZBy13desuHeVORmBDyAET4TkJr4SjqQy3A8JDofMN6LpkK8Xcm/dlw== | ||
version "3.2.1" | ||
resolved "https://registry.yarnpkg.com/loupe/-/loupe-3.2.1.tgz#0095cf56dc5b7a9a7c08ff5b1a8796ec8ad17e76" | ||
integrity sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ== | ||
|
||
lower-case-first@^1.0.0: | ||
version "1.0.2" | ||
|
@@ -22096,7 +22096,7 @@ lz-string@^1.5.0: | |
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" | ||
integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ== | ||
|
||
[email protected], magic-string@^0.30.10, magic-string@^0.30.11, magic-string@^0.30.12, magic-string@^0.30.17: | ||
[email protected]: | ||
version "0.30.17" | ||
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.17.tgz#450a449673d2460e5bbcfba9a61916a1714c7453" | ||
integrity sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA== | ||
|
@@ -22117,6 +22117,13 @@ magic-string@^0.26.7: | |
dependencies: | ||
sourcemap-codec "^1.4.8" | ||
|
||
magic-string@^0.30.10, magic-string@^0.30.11, magic-string@^0.30.12, magic-string@^0.30.17: | ||
version "0.30.19" | ||
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.19.tgz#cebe9f104e565602e5d2098c5f2e79a77cc86da9" | ||
integrity sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw== | ||
dependencies: | ||
"@jridgewell/sourcemap-codec" "^1.5.5" | ||
|
||
magicast@^0.3.5: | ||
version "0.3.5" | ||
resolved "https://registry.yarnpkg.com/magicast/-/magicast-0.3.5.tgz#8301c3c7d66704a0771eb1bad74274f0ec036739" | ||
|
@@ -30564,7 +30571,7 @@ tinypool@^1.0.1, tinypool@^1.1.1: | |
|
||
tinyrainbow@^1.2.0: | ||
version "1.2.0" | ||
resolved "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz#5c57d2fc0fb3d1afd78465c33ca885d04f02abb5" | ||
resolved "https://registry.yarnpkg.com/tinyrainbow/-/tinyrainbow-1.2.0.tgz#5c57d2fc0fb3d1afd78465c33ca885d04f02abb5" | ||
integrity sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ== | ||
|
||
tinyrainbow@^2.0.0: | ||
|
@@ -30574,7 +30581,7 @@ tinyrainbow@^2.0.0: | |
|
||
tinyspy@^3.0.2: | ||
version "3.0.2" | ||
resolved "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz#86dd3cf3d737b15adcf17d7887c84a75201df20a" | ||
resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-3.0.2.tgz#86dd3cf3d737b15adcf17d7887c84a75201df20a" | ||
integrity sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q== | ||
|
||
tinyspy@^4.0.3: | ||
|
@@ -32139,9 +32146,9 @@ [email protected], vite@^6.3.5: | |
fsevents "~2.3.3" | ||
|
||
vite@^5.0.0: | ||
version "5.4.18" | ||
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.18.tgz#b5af357f9d5ebb2e0c085779b7a37a77f09168a4" | ||
integrity sha512-1oDcnEp3lVyHCuQ2YFelM4Alm2o91xNoMncRm1U7S+JdYfYOvbiGZ3/CxGttrOu2M/KcGz7cRC2DoNUA6urmMA== | ||
version "5.4.20" | ||
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.20.tgz#3267a5e03f21212f44edfd72758138e8fcecd76a" | ||
integrity sha512-j3lYzGC3P+B5Yfy/pfKNgVEg4+UtcIJcVRt2cDjIOmhLourAqPqf8P7acgxeiSgUB7E3p2P8/3gNIgDLpwzs4g== | ||
dependencies: | ||
esbuild "^0.21.3" | ||
postcss "^8.4.43" | ||
|
@@ -32163,7 +32170,7 @@ vite@^5.0.0: | |
optionalDependencies: | ||
fsevents "~2.3.3" | ||
|
||
[email protected], vitest@^2.1.9: | ||
[email protected]: | ||
version "2.1.9" | ||
resolved "https://registry.yarnpkg.com/vitest/-/vitest-2.1.9.tgz#7d01ffd07a553a51c87170b5e80fea3da7fb41e7" | ||
integrity sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q== | ||
|
@@ -32189,7 +32196,7 @@ [email protected], vitest@^2.1.9: | |
vite-node "2.1.9" | ||
why-is-node-running "^2.3.0" | ||
|
||
[email protected], vitest@^3.0.9: | ||
vitest@^3.2.4: | ||
version "3.2.4" | ||
resolved "https://registry.yarnpkg.com/vitest/-/vitest-3.2.4.tgz#0637b903ad79d1539a25bc34c0ed54b5c67702ea" | ||
integrity sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A== | ||
|
Uh oh!
There was an error while loading. Please reload this page.