Skip to content

Commit

Permalink
🍨 Add padHex tests (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiksuJak authored Apr 26, 2024
1 parent b2f7c28 commit 023bc65
Show file tree
Hide file tree
Showing 4 changed files with 927 additions and 7 deletions.
6 changes: 4 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"typecheck": "tsc --noEmit",
"lint": "pnpm typecheck && biome check .",
"lint:fix": "biome check . --apply"
"lint:fix": "biome check . --apply",
"test": "vitest run"
},
"keywords": [],
"author": "",
Expand All @@ -15,6 +16,7 @@
"@biomejs/biome": "^1.6.1",
"@types/node": "^20.11.30",
"tsx": "^4.7.1",
"typescript": "^5.4.2"
"typescript": "^5.4.2",
"vitest": "^1.5.2"
}
}
16 changes: 16 additions & 0 deletions packages/core/test/utils/padHex.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { padHex } from 'src/utils/padHex'
import { describe, expect, it } from 'vitest'

describe('padHex', () => {
it('empty string', () => {
expect(padHex('')).toEqual('')
})

it('string of uneven length', () => {
expect(padHex('123')).toEqual('0123')
})

it('string of even length', () => {
expect(padHex('1234')).toEqual('1234')
})
})
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"strict": true,
"outDir": "./build"
},
"include": ["src"]
"include": ["src", "test"]
}
Loading

0 comments on commit 023bc65

Please sign in to comment.