2023-12-29 19:09:39 +00:00
|
|
|
import { describe, expect, it } from 'vitest'
|
2024-11-29 22:06:46 +00:00
|
|
|
import packageJson from '../package.json' with { type: 'json' }
|
2023-12-29 19:09:39 +00:00
|
|
|
|
|
|
|
|
describe('package.json', () => {
|
|
|
|
|
it('should have the correct name', () => {
|
|
|
|
|
expect(packageJson.name).toBe('hyparquet')
|
|
|
|
|
})
|
|
|
|
|
it('should have a valid version', () => {
|
|
|
|
|
expect(packageJson.version).toMatch(/^\d+\.\d+\.\d+$/)
|
|
|
|
|
})
|
2024-02-19 00:42:58 +00:00
|
|
|
it('should have MIT license', () => {
|
|
|
|
|
expect(packageJson.license).toBe('MIT')
|
|
|
|
|
})
|
2024-10-24 05:51:08 +00:00
|
|
|
it('should have precise dev dependency versions', () => {
|
2023-12-29 19:09:39 +00:00
|
|
|
const { devDependencies } = packageJson
|
|
|
|
|
Object.values(devDependencies).forEach(version => {
|
|
|
|
|
expect(version).toMatch(/^\d+\.\d+\.\d+$/)
|
|
|
|
|
})
|
|
|
|
|
})
|
2024-10-24 05:51:08 +00:00
|
|
|
it('should have no dependencies', () => {
|
|
|
|
|
expect('dependencies' in packageJson).toBe(false)
|
|
|
|
|
expect('peerDependencies' in packageJson).toBe(false)
|
|
|
|
|
})
|
2025-04-16 19:29:43 +00:00
|
|
|
it('should have exports with types first', () => {
|
|
|
|
|
const { exports } = packageJson
|
|
|
|
|
expect(exports).toBeDefined()
|
|
|
|
|
for (const [, exportObj] of Object.entries(exports)) {
|
|
|
|
|
if (typeof exportObj === 'object') {
|
|
|
|
|
expect(Object.keys(exportObj)).toEqual(['types', 'import'])
|
|
|
|
|
} else {
|
|
|
|
|
expect(typeof exportObj).toBe('string')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
2023-12-29 19:09:39 +00:00
|
|
|
})
|