Skip to content

Commit

Permalink
Merge pull request #3 from AcalaNetwork/add-test
Browse files Browse the repository at this point in the history
add test
  • Loading branch information
xlc authored Oct 24, 2022
2 parents 482e136 + e0c097e commit 2898304
Show file tree
Hide file tree
Showing 4 changed files with 510 additions and 3 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"fix": "eslint . --ext .js,.ts --fix && prettier -w .",
"prepare": "husky install",
"start": "ts-node src/index.ts",
"test": "vitest",
"dev": "LOG_LEVEL=trace node-dev --notify=false src/index.ts -- dev --endpoint=wss://karura-rococo-rpc.aca-staging.network/ws --head=0xecd7db7a9959ef8a3632789aed9e94cfdcd9790f64f310e0393c58295658e3a3 --executor-cmd='cargo run --manifest-path executor/Cargo.toml --' | pino-pretty"
},
"dependencies": {
Expand Down Expand Up @@ -38,7 +39,8 @@
"pino-pretty": "^9.1.1",
"prettier": "^2.7.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
"typescript": "^4.8.4",
"vitest": "^0.24.3"
},
"prettier": {
"tabWidth": 2,
Expand Down
8 changes: 8 additions & 0 deletions src/test/util.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { describe, it, expect } from 'vitest'
import { fetchKeys } from '../utils'

describe('suite', () => {
it('serial test', async () => {
await expect(fetchKeys(1 as any, 2 as any)).rejects.toThrowError()
})
})
7 changes: 7 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
// ...
},
})
Loading

0 comments on commit 2898304

Please sign in to comment.