Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
transform: {
'^.+\\.(ts|tsx)$': '<rootDir>/node_modules/ts-jest/preprocessor.js',
'^.+\\.(ts|tsx)$': 'ts-jest',
},
moduleFileExtensions: [
'ts',
Expand All @@ -13,5 +13,4 @@ module.exports = {
'<rootDir>/dist',
],
testEnvironment: 'node',
mapCoverage: true,
};
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
},
"homepage": "https://github.com/Fitbit/jsonrpc-ts#readme",
"devDependencies": {
"@types/jest": "^23.3.5",
"@types/node": "^10.12.0",
"io-ts": "^1.0.2",
"@types/jest": "^23.3.9",
"@types/node": "^10.12.9",
"io-ts": "1.4.1",
"jest": "^23.6.0",
"ts-jest": "^23.10.4",
"tslint": "^5.9.1",
"tslint-config-airbnb": "^5.6.0",
"typescript": "^3.1.3"
"tslint-config-airbnb": "^5.11.1",
"typescript": "^3.1.6"
},
"dependencies": {
"@types/error-subclass": "^2.2.0",
"error-subclass": "^2.2.0"
},
"peerDependencies": {
"io-ts": "^1.0.2"
"io-ts": "1.4.1"
}
}
4 changes: 2 additions & 2 deletions src/TypesafeRequestDispatcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ describe('dispatches a request', () => {
});
});

it(`returns the request handler function's return value`, () => {
it('returns the request handler function\'s return value', () => {
dispatcher.method('yarr', t.any, () => 'avast matey');
expect(dispatcher.onRequest('yarr', [])).toBe('avast matey');
});

it(`disallows registering methods beginning with 'rpc.'`, () => {
it('disallows registering methods beginning with \'rpc.\'', () => {
const handler = jest.fn();
expect(() => dispatcher.method('rpc.foo', t.any, handler))
.toThrow(TypeError);
Expand Down
2 changes: 1 addition & 1 deletion src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export const RequestJSON = t.intersection([
jsonrpc: t.literal('2.0'),
method: t.string,
id: RPCID,
params: t.union([RPCParams, t.undefined]),
}),
t.partial({
params: RPCParams,
result: t.undefined,
error: t.undefined,
}),
Expand Down
Loading