Skip to content

Commit 84714f5

Browse files
authored
test: enable type-checking of shared tests (npmx-dev#743)
1 parent ce04e81 commit 84714f5

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

nuxt.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ export default defineNuxtConfig({
248248
noUnusedLocals: true,
249249
},
250250
},
251+
sharedTsConfig: {
252+
include: ['../test/unit/shared/**/*.ts'],
253+
},
251254
nodeTsConfig: {
252255
compilerOptions: {
253256
allowImportingTsExtensions: true,

test/unit/shared/types/index.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { describe, expect, it } from 'vitest'
2-
import type { NpmPackage, NpmSearchResponse } from '../../../../shared/types'
2+
import type { Packument, NpmSearchResponse } from '../../../../shared/types'
33

44
describe('npm registry types', () => {
55
it('should correctly type a package response', () => {
6-
const pkg: NpmPackage = {
6+
const pkg: Packument = {
77
'_id': 'test-package',
88
'_rev': '1-abc123',
99
'name': 'test-package',
@@ -59,6 +59,7 @@ describe('npm registry types', () => {
5959
],
6060
total: 1,
6161
time: '2024-01-01T00:00:00.000Z',
62+
isStale: false,
6263
}
6364

6465
expect(response.total).toBe(1)

0 commit comments

Comments
 (0)