Skip to content

Commit

Permalink
Migrate to vitest (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
kigawas authored Oct 7, 2024
1 parent 9ef73bb commit 82c6d72
Show file tree
Hide file tree
Showing 24 changed files with 1,003 additions and 2,426 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
node-version: 22
registry-url: "https://registry.npmjs.org"

- run: pnpm install && pnpm test -- --bail --ci
- run: pnpm install && pnpm test -- --bail 1

- run: pnpm run build && npm publish
env:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ jobs:
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- run: pnpm install && pnpm test -- --bail --ci
- run: pnpm install && pnpm test -- --bail 1

- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- run: pnpm run build && npm publish --dry-run

- run: cd example && pnpm install
- run: node example/index.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ We recommend using the latest Node runtime although it's still possible to insta
import { PrivateKey, decrypt, encrypt } from "eciesjs";

const sk = new PrivateKey()
const data = Buffer.from('hello world🌍')
const data = Buffer.from("hello world🌍")
const decrypted = decrypt(sk.secret, encrypt(sk.publicKey.toHex(), data))
console.log(Buffer.from(decrypted).toString())
```
Expand Down
2 changes: 1 addition & 1 deletion example/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PrivateKey, decrypt, encrypt } from "eciesjs";

const sk = new PrivateKey()
const data = Buffer.from('hello world🌍')
const data = Buffer.from("hello world🌍")
const decrypted = decrypt(sk.secret, encrypt(sk.publicKey.toHex(), data))
console.log(Buffer.from(decrypted).toString())
8 changes: 0 additions & 8 deletions jest.config.ts

This file was deleted.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,19 @@
],
"scripts": {
"build": "npx tsc",
"test": "jest"
"test": "vitest"
},
"dependencies": {
"@noble/ciphers": "^1.0.0",
"@noble/curves": "^1.6.0",
"@noble/hashes": "^1.5.0"
},
"devDependencies": {
"@types/jest": "^29.5.13",
"@types/node": "^22.7.4",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"@vitest/coverage-v8": "2.1.2",
"typescript": "^5.6.2",
"undici": "^6.19.8"
"undici": "^6.19.8",
"vitest": "^2.1.2"
},
"packageManager": "pnpm@9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1"
"packageManager": "pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca"
}
Loading

0 comments on commit 82c6d72

Please sign in to comment.