diff --git a/package.json b/package.json index a845f8d..443ed2e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test": "npm run test:unit && npm run test:jest && npm run test:typescript", "test:jest": "jest jest.test.js", "test:unit": "c8 --100 node --test", - "test:typescript": "tsd" + "test:typescript": "tstyche" }, "repository": { "type": "git", @@ -67,6 +67,6 @@ "eslint": "^9.17.0", "jest": "^30.0.3", "neostandard": "^0.13.0", - "tsd": "^0.33.0" + "tstyche": "^7.0.0" } -} +} \ No newline at end of file diff --git a/types/index.test-d.ts b/types/index.test-d.ts deleted file mode 100644 index fe338e1..0000000 --- a/types/index.test-d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { expectType } from 'tsd' -import { createWarning, createDeprecation } from '..' - -const WarnInstance = createWarning({ - name: 'TypeScriptWarning', - code: 'CODE', - message: 'message' -}) - -expectType(WarnInstance.code) -expectType(WarnInstance.message) -expectType(WarnInstance.name) -expectType(WarnInstance.emitted) -expectType(WarnInstance.unlimited) - -expectType(WarnInstance()) -expectType(WarnInstance('foo')) -expectType(WarnInstance('foo', 'bar')) - -const buildWarnUnlimited = createWarning({ - name: 'TypeScriptWarning', - code: 'CODE', - message: 'message', - unlimited: true -}) -expectType(buildWarnUnlimited.unlimited) - -const DeprecationInstance = createDeprecation({ - code: 'CODE', - message: 'message' -}) -expectType(DeprecationInstance.code) - -DeprecationInstance() -DeprecationInstance('foo') -DeprecationInstance('foo', 'bar') diff --git a/types/index.tst.ts b/types/index.tst.ts new file mode 100644 index 0000000..2f953af --- /dev/null +++ b/types/index.tst.ts @@ -0,0 +1,38 @@ +import { expect } from 'tstyche' +import { createWarning, createDeprecation } from '..' + +const WarnInstance = createWarning({ + name: 'TypeScriptWarning', + code: 'CODE', + message: 'message' +}) + +expect(WarnInstance.code).type.toBe() +expect(WarnInstance.message).type.toBe() +expect(WarnInstance.name).type.toBe() +expect(WarnInstance.emitted).type.toBe() +expect(WarnInstance.unlimited).type.toBe() + +expect(WarnInstance()).type.toBe() +expect(WarnInstance('foo')).type.toBe() +expect(WarnInstance('foo', 'bar')).type.toBe() + +const buildWarnUnlimited = createWarning({ + name: 'TypeScriptWarning', + code: 'CODE', + message: 'message', + unlimited: true +}) + +expect(buildWarnUnlimited.unlimited).type.toBe() + +const DeprecationInstance = createDeprecation({ + code: 'CODE', + message: 'message' +}) + +expect(DeprecationInstance.code).type.toBe() + +expect(DeprecationInstance()).type.toBe() +expect(DeprecationInstance('foo')).type.toBe() +expect(DeprecationInstance('foo', 'bar')).type.toBe()