Skip to content

Commit

Permalink
add basic tsd test
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandrpravosudko-okta committed Apr 28, 2021
1 parent cc18abd commit b81c3ca
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
"jsonwebtoken": "^8.5.0",
"jwt-simple": "^0.5.5",
"mocha": "^6.0.2",
"secure-random": "^1.1.1"
"secure-random": "^1.1.1",
"tsd": "^0.14.0",
"typescript": "^4.2.4"
},
"tsd": {
"directory": "test/types",
"compilerOptions": {
"baseUrl": "./",
"paths": {
"njwt": ["."]
}
}
}
}
8 changes: 8 additions & 0 deletions test/types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"njwt": ["../../"]
}
}
}
7 changes: 7 additions & 0 deletions test/types/verify.test-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Verifier } from 'njwt';
import { expectType } from 'tsd';

const verifier = new Verifier();
expectType<Verifier>(verifier);

expectType<Verifier>(verifier.setSigningAlgorithm('none'));

0 comments on commit b81c3ca

Please sign in to comment.