Skip to content

Commit 8b56b29

Browse files
committed
test: 💍 setup testing
1 parent 9eecddd commit 8b56b29

File tree

6 files changed

+2451
-740
lines changed

6 files changed

+2451
-740
lines changed

package.json

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"lint:fix": "biome lint --apply ./src",
4545
"clean": "npx rimraf@6.0.1 lib typedocs coverage gh-pages yarn-error.log",
4646
"build": "tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib",
47-
"test": "vitest ./src",
48-
"coverage": "vitest run --coverage",
47+
"test": "jest --maxWorkers 7",
48+
"coverage": "yarn test --collectCoverage",
4949
"typedoc": "npx typedoc@0.25.13 --tsconfig tsconfig.build.json",
5050
"build:pages": "npx rimraf@6.0.1 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage",
5151
"deploy:pages": "gh-pages -d gh-pages",
@@ -65,13 +65,27 @@
6565
"devDependencies": {
6666
"@biomejs/biome": "^1.9.3",
6767
"@types/benchmark": "^2.1.5",
68+
"@types/jest": "^29.5.12",
6869
"@types/node": "^22.7.4",
69-
"@vitest/coverage-v8": "^2.1.2",
7070
"benchmark": "^2.1.4",
7171
"config-galore": "^1.0.0",
72+
"jest": "^29.7.0",
7273
"rxjs": "^7.8.1",
74+
"ts-jest": "^29.1.2",
7375
"tslib": "^2.7.0",
74-
"typescript": "^5.6.2",
75-
"vitest": "^2.1.2"
76+
"typescript": "^5.6.2"
77+
},
78+
"jest": {
79+
"moduleFileExtensions": [
80+
"ts",
81+
"js"
82+
],
83+
"transform": {
84+
"^.+\\.ts$": "ts-jest"
85+
},
86+
"transformIgnorePatterns": [
87+
".*/node_modules/.*"
88+
],
89+
"testRegex": ".*/(__tests__|__jest__|demo)/.*\\.(test|spec)\\.ts$"
7690
}
7791
}

src/codegen/binary/__tests__/JsonEncoderCodegenContext.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {testBinaryCodegen} from './testBinaryCodegen';
44
import {EncodingFormat} from '@jsonjoy.com/json-pack/lib/constants';
55
import {JsonEncoder} from '@jsonjoy.com/json-pack/lib/json/JsonEncoder';
66
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
7-
import {parse} from '../../../../json-binary';
7+
import {parse} from '@jsonjoy.com/json-pack/lib/json-binary';
88

99
const encoder = new JsonEncoder(new Writer(16));
1010

src/codegen/capacity/__tests__/CapacityEstimatorCodegenContext.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {maxEncodingCapacity} from '../../../../json-size';
1+
import {maxEncodingCapacity} from '@jsonjoy.com/util/lib/json-size';
22
import {TypeSystem} from '../../../system';
33

44
describe('"any" type', () => {

src/type/__tests__/toJson.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {t} from '..';
2-
import {parse} from '../../../json-binary';
2+
import {parse} from '@jsonjoy.com/json-pack/lib/json-binary';
33
import {TypeSystem} from '../../system/TypeSystem';
44
import {everyType, everyTypeValue} from './fixtures';
55

src/value/__tests__/ObjectValue.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {TypeSystem} from '../../json-type/system';
1+
import {TypeSystem} from '../../system';
22
import {ObjectValue} from '../ObjectValue';
33

44
test('can retrieve field as Value', () => {

0 commit comments

Comments
 (0)