mirror of
https://github.com/zkitter/json-rpc-engine.git
synced 2026-01-09 15:17:56 -05:00
Migrates all tests to Jest and TypeScript per the module template. Care was taken to modify the existing tests as little as possible. Therefore, the tests unfortunately make prodigious use of casts to `any`. Nevertheless, to minimize such casts, a pair of assertion type guards were added for successful and failed JSON-RPC responses. They use the existing boolean type guards under the hood, and are fully tested. Assertion type guards are tremendously helpful in situations like this, where boolean type guards don't help since e.g. `expect(typeGuard(value)).toBe(true);` doesn't tell TypeScript anything, and we have lint rules preventing us from calling `expect` conditionally.
18 lines
372 B
JSON
18 lines
372 B
JSON
{
|
|
"compilerOptions": {
|
|
"declaration": true,
|
|
"esModuleInterop": true,
|
|
"inlineSources": true,
|
|
"lib": ["ES2020"],
|
|
"module": "CommonJS",
|
|
"moduleResolution": "Node",
|
|
"outDir": "dist",
|
|
"rootDir": "src",
|
|
"sourceMap": true,
|
|
"strict": true,
|
|
"target": "ES2017"
|
|
},
|
|
"exclude": ["./src/**/*.test.ts"],
|
|
"include": ["./src/**/*.ts"]
|
|
}
|