Skip to content

Commit 47f163d

Browse files
committed
feat: migrate packages/utils jest to vitest
- replace jest with vitest - remove jest references no longer used - add vitest configuration file in package - add vitest configuration file to workspace
1 parent d878d06 commit 47f163d

File tree

12 files changed

+619
-15
lines changed

12 files changed

+619
-15
lines changed

packages/utils/jest.config.js

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

packages/utils/jest.setup.js

Whitespace-only changes.

packages/utils/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,15 @@
4141
"prepare": "yarn build",
4242
"prepublishOnly": "yarn test && yarn lint",
4343
"pretest": "yarn build:test",
44-
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest"
44+
"test": "vitest run"
4545
},
4646
"dependencies": {
4747
"@bitauth/libauth": "^3.1.0-next.2"
4848
},
4949
"devDependencies": {
50-
"@jest/globals": "^29.7.0",
5150
"eslint": "^8.54.0",
52-
"jest": "^29.7.0",
53-
"typescript": "^5.9.2"
51+
"typescript": "^5.9.2",
52+
"vitest": "^3.2.4"
5453
},
5554
"gitHead": "bf02a4b641d5d03c035d052247a545109c17b708"
5655
}

packages/utils/test/bitauth-script.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { asmToScript } from '../src/script.js';
22
import { buildLineToOpcodesMap, buildLineToAsmMap, formatBitAuthScript } from '../src/bitauth-script.js';
33
import { fixtures } from './fixtures/bitauth-script.fixture.js';
44
import { compileString } from 'cashc';
5+
import { describe, it, expect } from 'vitest';
56

67
describe('Libauth Script formatting', () => {
78
fixtures.forEach((fixture) => {

packages/utils/test/data.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
encodeString,
99
placeholder,
1010
} from '../src/index.js';
11+
import { describe, it, expect } from 'vitest';
1112

1213
describe('data utils', () => {
1314
describe('encodeBool()', () => {

packages/utils/test/hash.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
sha256,
77
sha512,
88
} from '../src/index.js';
9+
import { describe, it, expect } from 'vitest';
910

1011
describe('hashing functions', () => {
1112
describe('sha512()', () => {

packages/utils/test/script.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
scriptToBytecode,
1212
} from '../src/index.js';
1313
import { fixtures } from './script.fixture.js';
14+
import { describe, it, expect } from 'vitest';
1415

1516
describe('script utils', () => {
1617
describe('scriptToAsm()', () => {

packages/utils/test/source-map.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { generateSourceMap, sourceMapToLocationData } from '../src/index.js';
22
import { fixtures } from './fixtures/source-map.fixture.js';
3+
import { describe, it, expect } from 'vitest';
34

45
describe('Source map generation', () => {
56
fixtures.forEach((fixture) => {

packages/utils/test/types.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
PrimitiveType,
77
TupleType,
88
} from '../src/index.js';
9+
import { describe, it, expect } from 'vitest';
910

1011
describe('type utilities', () => {
1112
describe('explicitlyCastable()', () => {

packages/utils/vitest.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
root: './dist-test',
5+
test: {
6+
environment: 'node',
7+
reporters: ['verbose'],
8+
coverage: {
9+
provider: 'v8',
10+
reporter: ['json-summary'],
11+
},
12+
},
13+
});

0 commit comments

Comments
 (0)