Skip to content

Commit 16b7339

Browse files
chore(repo): test migration to vitest. phase 2 (#1976)
* test: migrate phase 2 packages from ava to vitest * chore: update pnpm lockfile for wasm types-registry * fix(wasm): remove accidental types-registry dependency --------- Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
1 parent 796cd55 commit 16b7339

33 files changed

Lines changed: 1295 additions & 1260 deletions

.config/vitest.config.mts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,21 @@ export default defineConfig({
55
test: {
66
// Enable global APIs for CommonJS test files.
77
globals: true,
8-
// Phase 1 packages use runtime-style test entrypoints.
9-
include: ['test/test.{js,mjs,cjs,ts,mts,cts}'],
8+
// Phase 1/2 packages use runtime-style, *.test, and a few named entrypoints.
9+
include: [
10+
'test/test.{js,mjs,cjs,ts,mts,cts}',
11+
'test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts}',
12+
'test/{as-input-plugin,as-output-plugin,form,function,misc,sourcemaps}.{js,mjs,cjs,ts,mts,cts}'
13+
],
14+
exclude: [
15+
'**/test/fixtures/**',
16+
'**/test/helpers/**',
17+
'**/test/node_modules/**',
18+
'**/test/recipes/**',
19+
'**/test/output/**',
20+
'**/test/snapshots/**',
21+
'**/test/types.ts'
22+
],
1023
// Keep snapshots in the same location used by Ava.
1124
resolveSnapshotPath: (testPath, snapExt) =>
1225
path.join(path.dirname(testPath), 'snapshots', path.basename(testPath) + snapExt)

packages/babel/package.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
"ci:coverage": "nyc pnpm test && nyc report --reporter=text-lcov > coverage.lcov",
2929
"ci:lint": "pnpm build && pnpm lint",
3030
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
31-
"ci:test": "pnpm test -- --verbose",
31+
"ci:test": "pnpm test -- --reporter=verbose",
3232
"prebuild": "del-cli dist",
3333
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
3434
"prerelease": "pnpm build",
3535
"pretest": "pnpm build",
3636
"release": "pnpm --workspace-root package:release $(pwd)",
37-
"test": "ava",
37+
"test": "vitest --config ../../.config/vitest.config.mts run",
3838
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
3939
},
4040
"files": [
@@ -83,14 +83,6 @@
8383
"source-map": "^0.7.4"
8484
},
8585
"types": "./types/index.d.ts",
86-
"ava": {
87-
"files": [
88-
"!**/fixtures/**",
89-
"!**/helpers/**",
90-
"!**/recipes/**",
91-
"!**/types.ts"
92-
]
93-
},
9486
"contributors": [
9587
"Bogdan Chadkin <trysound@yandex.ru>",
9688
"Mateusz Burzyński <mateuszburzynski@gmail.com> (https://github.com/Andarist)"

0 commit comments

Comments
 (0)