Skip to content

Commit

Permalink
migrate to vitest (#46)
Browse files Browse the repository at this point in the history
* migrate jest -> vitest due to ESM compat issues
* migrate stryker jest to stryker vitest
  • Loading branch information
molszanski authored Nov 18, 2024
1 parent 97bbc1e commit 890f3bf
Show file tree
Hide file tree
Showing 25 changed files with 2,077 additions and 1,364 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lib-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "22"

## Cache not important
- name: Get yarn cache directory path
Expand Down
11 changes: 0 additions & 11 deletions iti/jest.config.cjs

This file was deleted.

19 changes: 11 additions & 8 deletions iti/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,21 @@
],
"scripts": {
"build": "make build",
"jest": "jest",
"stryker": "stryker",
"stryker:run": "stryker run",
"test": "yarn jest && yarn tsd",
"jestWatch": "jest --watch --verbose",
"tsd": "tsd tsd_project"
"test": "vitest && yarn tsd",
"tsd": "tsd tsd_project",
"v": "vitest",
"vitest:types": "vitest --typecheck"
},
"dependencies": {
"utility-types": "^3.10.0"
},
"devDependencies": {
"@stryker-mutator/core": "^6.1.2",
"@stryker-mutator/jest-runner": "^6.1.2",
"@stryker-mutator/typescript-checker": "^6.1.2",
"@stryker-mutator/core": "^8.6.0",
"@stryker-mutator/jest-runner": "^8.6.0",
"@stryker-mutator/typescript-checker": "^8.6.0",
"@stryker-mutator/vitest-runner": "^8.6.0",
"@types/jest": "^29.5.14",
"@types/react": "^18.0.15",
"jest": "^29.7.0",
Expand All @@ -55,7 +56,8 @@
"stryker-cli": "^1.0.2",
"ts-jest": "^29.2.5",
"tsd": "^0.22.0",
"typescript": "^4.7.4"
"typescript": "^4.7.4",
"vitest": "^2.1.4"
},
"engines": {
"node": ">=12"
Expand All @@ -78,6 +80,7 @@
"type-safe"
],
"homepage": "https://itijs.org",
"// CONFIGS: ": "Package configs",
"prettier": {
"semi": false,
"singleQuote": false,
Expand Down
9 changes: 2 additions & 7 deletions iti/stryker.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
"$schema": "https://raw.githubusercontent.com/stryker-mutator/stryker/master/packages/api/schema/stryker-core.json",
"_comment": "This config was generated using 'stryker init'. Please take a look at: https://stryker-mutator.io/docs/stryker-js/configuration/ for more information",
"packageManager": "yarn",
"_commandRunner": { "command": "yarn jest" },
"_commandRunner": { "command": "yarn vitest" },
"reporters": ["html", "clear-text", "progress", "dashboard", "json"],
"testRunner": "jest",
"testRunner": "vitest",
"disableTypeChecks": "{test,tests,src,lib}/**/*.{js,ts,jsx,tsx,html,vue}",
"jest": {
"projectType": "custom",
"configFile": "./jest.config.cjs",
"enableFindRelatedTests": false
},
"coverageAnalysis": "off",
"checkers": ["typescript"],
"tsconfigFile": "tsconfig.json"
Expand Down
14 changes: 0 additions & 14 deletions iti/tests/__snapshots__/container-getter.spec.ts.snap

This file was deleted.

14 changes: 14 additions & 0 deletions iti/tests/__snapshots__/container-getter.vi.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Getter tests > should get a single container 1`] = `
{
"b1": B1 {
"a2": A2 {
"a1": A1 {},
},
},
"b2": B2 {
"a1": A1 {},
},
}
`;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`should get container set via a new API 1`] = `
exports[`Container set: > should get container set via a new API 1`] = `
{
"aCont": {
"a1": {},
Expand All @@ -27,7 +27,7 @@ exports[`should get container set via a new API 1`] = `
}
`;

exports[`should get two containers that are async 1`] = `
exports[`Container set: > should get two containers that are async 1`] = `
{
"aCont": {
"a1": {},
Expand Down
14 changes: 0 additions & 14 deletions iti/tests/__snapshots__/getter.spec.ts.snap

This file was deleted.

14 changes: 14 additions & 0 deletions iti/tests/__snapshots__/getter.vi.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Node getter > should get nested containers 1`] = `
{
"b1": B1 {
"a2": A2 {
"a1": A1 {},
},
},
"b2": B2 {
"a1": A1 {},
},
}
`;
156 changes: 0 additions & 156 deletions iti/tests/container-get-values.spec.ts

This file was deleted.

Loading

0 comments on commit 890f3bf

Please sign in to comment.