Skip to content

Commit

Permalink
Package tests
Browse files Browse the repository at this point in the history
  • Loading branch information
platypii committed Jun 6, 2024
1 parent 15ad34b commit 1dc5942
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ jobs:
- uses: actions/checkout@v3
- run: npm i
- run: tsc

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm i
- run: npm test
20 changes: 20 additions & 0 deletions test/package.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { describe, expect, it } from 'vitest'
import packageJson from '../package.json'

describe('package.json', () => {
it('should have the correct name', () => {
expect(packageJson.name).toBe('hyperparam')
})
it('should have a valid version', () => {
expect(packageJson.version).toMatch(/^\d+\.\d+\.\d+$/)
})
it('should have MIT license', () => {
expect(packageJson.license).toBe('MIT')
})
it('should have precise dependency versions', () => {
const { devDependencies } = packageJson
Object.values(devDependencies).forEach(version => {
expect(version).toMatch(/^\d+\.\d+\.\d+$/)
})
})
})
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"module": "nodenext",
"noEmit": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
},
"include": ["src", "test"]
Expand Down

0 comments on commit 1dc5942

Please sign in to comment.