Skip to content

Commit

Permalink
build: replace ava with vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Jul 26, 2023
1 parent 4f317d1 commit a6fe911
Show file tree
Hide file tree
Showing 31 changed files with 1,146 additions and 1,264 deletions.
23 changes: 14 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,26 @@
},
{
"files": ["**/*.test.ts"],
"plugins": ["ava"],
"extends": ["plugin:ava/recommended"],
"rules": {
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"jsdoc/require-jsdoc": "off"
}
},
{
"files": "tests/helpers/testers.ts",
"rules": {
"ava/no-ignored-test-files": "off"
"@typescript-eslint/no-unused-vars-experimental": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"eslint-comments/disable-enable-pair": "off",
"eslint-comments/no-unlimited-disable": "off",
"functional/functional-parameters": "off",
"functional/no-conditional-statements": "off",
"functional/no-expression-statements": "off",
"functional/no-loop-statements": "off",
"functional/no-return-void": "off",
"import/no-named-as-default-member": "off",
"jsdoc/require-jsdoc": "off",
"sonarjs/no-duplicate-string": "off",
"sonarjs/no-identical-functions": "off",
"unicorn/prefer-module": "off"
}
},
{
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
/coverage/
/tests-compiled/

.nyc_output/

node_modules/

*.log
Expand Down
13 changes: 0 additions & 13 deletions .nycrc

This file was deleted.

2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
/coverage/
/tests-compiled/

.nyc_output/

node_modules/
pnpm-lock.yaml

Expand Down
19 changes: 7 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "AVA Test Current Test File",
"program": "${workspaceFolder}/node_modules/ava/entrypoints/cli.mjs",
"args": ["${file}"],
"outputCapture": "std",
"skipFiles": ["<node_internals>/**/*.js"],
"env": {
"TEST_ALL_FILES": "1"
},
"name": "Debug Current Test File",
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
"args": ["run", "${relativeFile}"],
"smartStep": true,
"sourceMaps": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
"console": "integratedTerminal"
}
]
}
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"files.exclude": {
".nyc_output": true,
"coverage": true,
"cz-adapter/index.js": true
},
Expand Down
36 changes: 0 additions & 36 deletions ava.config.mjs

This file was deleted.

3 changes: 2 additions & 1 deletion knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"project": ["src/**/*.ts!", "tests/**/*.ts", "cz-adapter/**/*.ts"],
"ignoreDependencies": [
"@typescript-eslint/eslint-plugin-disable-type-checked",
"glob"
"glob",
"@vitest/coverage-v8"
],
"ignore": ["tests/fixture/file.ts"]
}
16 changes: 6 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
"prepare": "husky install",
"release": "semantic-release",
"test": "pnpm run test:js",
"test-compiled": "USE_COMPILED_TESTS=1 nyc ava",
"test-work": "ONLY_TEST_WORK_FILE=1 ava",
"test:js": "nyc ava",
"test-compiled": "USE_COMPILED_TESTS=1 vitest run --coverage",
"test-work": "vitest",
"test:js": "vitest",
"type-check": "tsc --noEmit --skipLibCheck",
"verify": "pnpm run lint && pnpm run type-check && pnpm run build-tests && pnpm run test-compiled && rimraf build"
},
Expand All @@ -79,14 +79,12 @@
"ts-api-utils": "^1.0.1"
},
"devDependencies": {
"@ava/typescript": "4.1.0",
"@babel/core": "7.22.9",
"@babel/eslint-parser": "7.22.9",
"@commitlint/cli": "17.6.7",
"@commitlint/config-conventional": "17.6.7",
"@cspell/dict-cryptocurrencies": "3.0.1",
"@google/semantic-release-replace-plugin": "1.2.7",
"@istanbuljs/nyc-config-typescript": "1.0.2",
"@rebeccastevens/eslint-config": "2.0.2",
"@rollup/plugin-commonjs": "25.0.3",
"@rollup/plugin-json": "6.0.0",
Expand All @@ -105,7 +103,7 @@
"@typescript-eslint/eslint-plugin": "6.1.0",
"@typescript-eslint/parser": "6.1.0",
"@typescript-eslint/rule-tester": "6.1.0",
"ava": "5.3.1",
"@vitest/coverage-c8": "0.33.0",
"chalk": "4.1.2",
"commitizen": "4.3.0",
"conventional-commit-types": "3.0.0",
Expand All @@ -115,7 +113,6 @@
"eslint-config-prettier": "8.8.0",
"eslint-doc-generator": "1.4.3",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-ava": "14.0.0",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-eslint-plugin": "5.1.1",
"eslint-plugin-import": "2.27.5",
Expand All @@ -133,17 +130,16 @@
"knip": "2.16.1",
"lint-staged": "13.2.3",
"markdownlint-cli": "0.35.0",
"nyc": "15.1.0",
"prettier": "3.0.0",
"prettier-plugin-packagejson": "2.4.5",
"rimraf": "5.0.1",
"rollup": "3.26.3",
"rollup-plugin-auto-external": "2.0.0",
"semantic-release": "21.0.7",
"ts-node": "10.9.1",
"tsconfig-paths": "4.2.0",
"tslib": "2.6.0",
"typescript": "5.1.6",
"vite-tsconfig-paths": "4.2.0",
"vitest": "0.33.0",
"word-wrap": "1.2.5"
},
"peerDependencies": {
Expand Down

0 comments on commit a6fe911

Please sign in to comment.