Skip to content

Commit c5b216c

Browse files
committed
🔧 Modify test:unit script to use vitest
1 parent 4c39359 commit c5b216c

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

package.json

+2-14
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"lint:fix": "npm run lint:tests -- --fix && npm run lint:examples -- --fix && npm run lint:src:agile -- --fix && npm run lint:src:clients -- --fix && npm run lint:src:services -- --fix && npm run lint:src:version2 -- --fix && npm run lint:src:version3 -- --fix && npm run lint:src:serviceDesk -- --fix && npm run lint:src:files -- --fix",
3636
"doc": "typedoc --name \"Jira.js - Jira Cloud API library\" --out docs ./src/index.ts --plugin typedoc-plugin-extras --footerDate --footerTime --footerTypedocVersion --favicon https://svgshare.com/i/bHF.svg",
3737
"test": "npm run test:unit && npm run test:integration",
38-
"test:unit": "vitest tests/unit --timeout=2m -с 8",
39-
"test:integration": "vitest --timeout=2m --fail-fast --no-worker-threads -c 1 -s tests/integration/**/*.test.ts",
38+
"test:unit": "vitest tests/unit --maxWorkers=8 --sequence.concurrent",
39+
"test:integration": "vitest --bail=1 --no-file-parallelism --max-concurrency 1 tests/integration",
4040
"replace:all": "npm run replace:permissions:version2 && npm run replace:permissions:version3 && npm run replace:pagination:version2 && npm run replace:pagination:version3 && npm run replace:async:version2 && npm run replace:async:version3 && npm run replace:expansion:version2 && npm run replace:expansion:version3 && npm run replace:ordering:version2 && npm run replace:ordering:version3 && npm run replace:groupMember:version2 && npm run replace:workflowPaginated:version2",
4141
"replace:permissions:version2": "grep -rl \"(#permissions)\" ./src/version2 | xargs sed -i '' 's/(#permissions)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v2\\/intro\\/#permissions)/g'",
4242
"replace:permissions:version3": "grep -rl \"(#permissions)\" ./src/version3 | xargs sed -i '' 's/(#permissions)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v3\\/intro\\/#permissions)/g'",
@@ -52,18 +52,6 @@
5252
"replace:workflowPaginated:version2": "grep -rl \"(#api-rest-api-2-workflow-search-get)\" ./src/version2 | xargs sed -i '' 's/(#api-rest-api-2-workflow-search-get)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v2\\/api-group-workflows\\/#api-rest-api-2-workflow-search-get)/g'",
5353
"code:formatting": "npm run replace:all && npm run prettier && npm run lint:fix"
5454
},
55-
"ava": {
56-
"extensions": [
57-
"ts"
58-
],
59-
"require": [
60-
"@swc-node/register",
61-
"dotenv/config"
62-
],
63-
"environmentVariables": {
64-
"SWC_NODE_PROJECT": "./tsconfig.lint.json"
65-
}
66-
},
6755
"devDependencies": {
6856
"@swc-node/register": "^1.9.1",
6957
"@swc/helpers": "^0.5.11",

vitest.config.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
test: {
5+
typecheck: {
6+
enabled: true,
7+
tsconfig: 'tsconfig.lint.json',
8+
},
9+
},
10+
});

0 commit comments

Comments
 (0)