diff --git a/package.json b/package.json index 254111e..48cd6c7 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lint": "eslint", "lint:fix": "eslint --fix", "test": "npm run test:unit && npm run test:typescript", - "test:typescript": "tsd", + "test:typescript": "tstyche", "test:unit": "c8 -100 node --test" }, "repository": { @@ -78,9 +78,9 @@ "shortid": "^2.2.16", "superheroes": "^4.0.0", "svelte": "^3.44.0", - "tsd": "^0.33.0" + "tstyche": "^7.0.0" }, "publishConfig": { "access": "public" } -} +} \ No newline at end of file diff --git a/types/index.test-d.ts b/types/index.tst.ts similarity index 75% rename from types/index.test-d.ts rename to types/index.tst.ts index a449398..24ca7de 100644 --- a/types/index.test-d.ts +++ b/types/index.tst.ts @@ -1,7 +1,7 @@ import fastify, { FastifyInstance } from 'fastify' import hotwire from '..' import { join } from 'node:path' -import { expectType } from 'tsd' +import { expect } from 'tstyche' const app: FastifyInstance = fastify() app.register(hotwire, { @@ -10,10 +10,14 @@ app.register(hotwire, { }) app.get('/stream', async (_req, reply) => { + expect( + reply.turboStream.append('file', 'target', { hello: 'world' }) + ).type.toBe(reply) + return reply.turboStream.append('file', 'target', { hello: 'world' }) }) app.get('/generate', async (_req, reply) => { const fragment = await reply.turboGenerate.append('file', 'target', { hello: 'world' }) - expectType(fragment) + expect(fragment).type.toBe() })