Skip to content

Commit

Permalink
Migrate cryptography-utils from jest to vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 18, 2023
1 parent 36ee8bc commit b2c2f02
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
5 changes: 0 additions & 5 deletions packages/libs/cryptography-utils/jest.config.js

This file was deleted.

7 changes: 3 additions & 4 deletions packages/libs/cryptography-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"lint:fmt": "prettier . --cache --check",
"lint:pkg": "lint-package",
"lint:src": "eslint src --ext .js,.ts",
"test": "jest"
"test": "vitest"
},
"dependencies": {
"blakejs": "^1.2.1",
Expand All @@ -54,12 +54,11 @@
"@kadena/types": "workspace:*",
"@microsoft/api-extractor": "^7.38.0",
"@rushstack/eslint-config": "~3.3.0",
"@types/jest": "^29.5.3",
"@types/node": "^18.17.14",
"eslint": "^8.45.0",
"jest": "^29.7.0",
"prettier": "~3.0.3",
"typescript": "5.2.2"
"typescript": "5.2.2",
"vitest": "^0.34.6"
},
"publishConfig": {
"provenance": true
Expand Down
16 changes: 9 additions & 7 deletions packages/libs/cryptography-utils/src/tests/genKeyPair.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
jest.mock('tweetnacl', () => {
vi.mock('tweetnacl', () => {
return {
sign: {
keyPair: () => {
return {
publicKey: '1234567abcdefg',
secretKey: '1234567abcdefg',
};
default: {
sign: {
keyPair: () => {
return {
publicKey: '1234567abcdefg',
secretKey: '1234567abcdefg',
};
},
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/libs/cryptography-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "./node_modules/@kadena-dev/heft-rig/tsconfig-base.json",
"compilerOptions": {
"types": ["jest", "node"]
"types": ["vitest/globals", "node"]
}
}
8 changes: 8 additions & 0 deletions packages/libs/cryptography-utils/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
include: ['src/**/*.test.ts'],
globals: true,
},
});
9 changes: 3 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b2c2f02

Please sign in to comment.