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 6279878
Show file tree
Hide file tree
Showing 2 changed files with 27 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+$/)
})
})
})

0 comments on commit 6279878

Please sign in to comment.