Skip to content

Commit e4988e0

Browse files
committed
fix(test): move to vitest as jest does too much magic
BREAKING CHANGE: removes support for jest
1 parent 8b487e3 commit e4988e0

File tree

14 files changed

+933
-2481
lines changed

14 files changed

+933
-2481
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,4 @@ jest.config.cjs
6767
jest.config.js
6868
.prettierrc.js
6969
.eslintrc.js
70+
vitest.config.ts

.husky/commit-msg

Lines changed: 0 additions & 4 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 0 additions & 4 deletions
This file was deleted.

.trunk/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*out
2+
*logs
3+
*actions
4+
*notifications
5+
plugins
6+
user_trunk.yaml
7+
user.yaml
8+
tools

.trunk/configs/.markdownlint.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Autoformatter friendly markdownlint config (all formatting rules disabled)
2+
default: true
3+
blank_lines: false
4+
bullet: false
5+
html: false
6+
indentation: false
7+
line_length: false
8+
spaces: false
9+
url: false
10+
whitespace: false

.trunk/configs/.shellcheckrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
enable=all
2+
source-path=SCRIPTDIR
3+
disable=SC2154
4+
5+
# If you're having issues with shellcheck following source, disable the errors via:
6+
# disable=SC1090
7+
# disable=SC1091

.trunk/configs/.yamllint.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
rules:
2+
quoted-strings:
3+
required: only-when-needed
4+
extra-allowed: ['{|}']
5+
empty-values:
6+
forbid-in-block-mappings: true
7+
forbid-in-flow-mappings: true
8+
key-duplicates: {}
9+
octal-values:
10+
forbid-implicit-octal: true

.trunk/trunk.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 0.1
2+
cli:
3+
version: 1.13.0
4+
plugins:
5+
sources:
6+
- id: trunk
7+
ref: v1.1.1
8+
uri: https://github.com/trunk-io/plugins
9+
lint:
10+
enabled:
11+
12+
13+
14+
- git-diff-check
15+
16+
17+
18+
19+
20+
21+
22+
23+
ignore:
24+
- linters: [ALL]
25+
paths:
26+
- .yarn/**
27+
- yarn.lock
28+
- gha-creds-*.json
29+
runtimes:
30+
enabled:
31+
32+
33+
34+
actions:
35+
enabled:
36+
- trunk-announce
37+
- trunk-check-pre-push
38+
- trunk-fmt-pre-commit
39+
- trunk-upgrade-available

__tests__/index.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { expect, test } from 'vitest';
2+
13
import { config } from '../src';
24

35
test('index', () => {

package.json

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
"main": "./build/index.js",
66
"types": "build/index.d.ts",
77
"scripts": {
8-
"test": "jest",
8+
"test": "vitest",
99
"build": "tsc -p tsconfig.build.json",
1010
"clean": "yarn dlx rimraf ./build",
11-
"prepare": "husky install",
1211
"lint": "eslint .",
13-
"prepack": "pinst --disable",
14-
"postpack": "pinst --enable",
15-
"postinstall": "husky install && coconfig",
12+
"postinstall": "coconfig",
1613
"semantic-release": "semantic-release"
1714
},
1815
"engines": {
@@ -28,9 +25,6 @@
2825
"typescript",
2926
"openapi"
3027
],
31-
"lint-staged": {
32-
"*.{js,jsx,ts,tsx}": "yarn eslint --cache --fix"
33-
},
3428
"release": {
3529
"branches": [
3630
"main"
@@ -39,6 +33,10 @@
3933
"devDependencies": {
4034
"@commitlint/cli": "^17.6.7",
4135
"@commitlint/config-conventional": "^17.6.7",
36+
"@semantic-release/changelog": "^6.0.3",
37+
"@semantic-release/commit-analyzer": "^10.0.1",
38+
"@semantic-release/exec": "^6.0.3",
39+
"@semantic-release/release-notes-generator": "^11.0.4",
4240
"@types/jest": "^29.5.3",
4341
"@types/node": "^18.17.1",
4442
"@typescript-eslint/eslint-plugin": "^6.2.0",
@@ -47,16 +45,11 @@
4745
"eslint": "^8.46.0",
4846
"eslint-config-prettier": "^8.9.0",
4947
"eslint-plugin-import": "^2.28.0",
50-
"eslint-plugin-jest": "^27.2.3",
51-
"husky": "^8.0.3",
52-
"jest": "^29.6.2",
53-
"lint-staged": "^13.2.3",
5448
"pinst": "^3.0.0",
5549
"semantic-release": "^21.0.7",
56-
"ts-jest": "^29.1.1",
57-
"ts-jest-resolver": "^2.0.1",
5850
"ts-node": "^10.9.1",
59-
"typescript": "^5.1.6"
51+
"typescript": "^5.1.6",
52+
"vitest": "^0.34.2"
6053
},
6154
"packageManager": "[email protected]"
6255
}

0 commit comments

Comments
 (0)