Skip to content

Commit 96b472e

Browse files
committed
refactor: move type tests back to types/ directory
Move .test-d.ts files back to types/ to match the convention used by other fastify ecosystem packages (fastify-cors, fastify-helmet, fastify-rate-limit, fastify-cookie). This also avoids cross-platform issues with node --test glob expansion on Windows and Node.js 20. Revert test:unit script to plain `c8 --100 node --test` since .test-d.ts files in types/ are not auto-discovered by the test runner.
1 parent d821fbc commit 96b472e

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"start": "CLIMEM=8999 node -r climem ./examples/example",
3939
"test": "npm run test:unit && npm run test:typescript",
4040
"test:typescript": "tsd",
41-
"test:unit": "c8 --100 node --test test/*.test.js"
41+
"test:unit": "c8 --100 node --test"
4242
},
4343
"repository": {
4444
"type": "git",
@@ -86,7 +86,7 @@
8686
],
8787
"license": "MIT",
8888
"tsd": {
89-
"directory": "test/types"
89+
"directory": "types"
9090
},
9191
"publishConfig": {
9292
"access": "public"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fastify from 'fastify'
22
import { expectType } from 'tsd'
33
import type Ajv from 'ajv'
4-
import { fastifyMultipart, ajvFilePlugin } from '../..'
4+
import { fastifyMultipart, ajvFilePlugin } from '..'
55

66
// Test: ajvFilePlugin should be compatible with Fastify's ajv.plugins option
77
const app = fastify({
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-unused-expressions */
22
import fastify from 'fastify'
3-
import fastifyMultipart, { MultipartValue, MultipartFields, MultipartFile } from '../..'
3+
import fastifyMultipart, { MultipartValue, MultipartFields, MultipartFile } from '..'
44
import * as util from 'node:util'
55
import { pipeline } from 'node:stream'
66
import * as fs from 'node:fs'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import fastify from 'fastify'
2-
import { fastifyMultipart } from '../..'
2+
import { fastifyMultipart } from '..'
33

44
const app = fastify()
55

0 commit comments

Comments
 (0)