@pawsteam/ts-jsonrpc-server
Advanced tools
Comparing version 0.2.5 to 0.2.6
/// <reference types="node" /> | ||
import { ValidatorInterface } from "@interfaces/Validator.interface"; | ||
import { IncomingMessage } from "http"; | ||
import { ValidatorInterface } from "@interfaces/interfaces"; | ||
export declare class ParamsValidator implements ValidatorInterface { | ||
@@ -5,0 +5,0 @@ schema: any; |
@@ -18,3 +18,2 @@ "use strict"; | ||
const Engine_type_1 = require("./utils/Engine.type"); | ||
const http_1 = require("http"); | ||
const HeaderValueContains_validator_1 = require("../../src/validators/HeaderValueContains.validator"); | ||
@@ -25,2 +24,3 @@ const RemoveTests_serializer_1 = require("./utils/RemoveTests.serializer"); | ||
const RabbitEventEmitter_service_1 = require("../../src/services/RabbitEventEmitter.service"); | ||
const RequestContext_type_1 = require("../../src/types/RequestContext.type"); | ||
const ConfigKeeper = ConfigKeeper_1.ConfigKeeper.getInstance(); | ||
@@ -258,4 +258,9 @@ describe('HTTP Server', () => { | ||
it('Uses one transformer to pass the right type of param', (done) => { | ||
let fn = jest.fn(); | ||
fn.mockResolvedValue('cartype'); | ||
let fn = (p1, p2) => { | ||
console.log('Called!!!!!'); | ||
expect(p1 instanceof Car_type_1.CarType); | ||
expect(p2 instanceof RequestContext_type_1.RequestContextType); | ||
done(); | ||
return Promise.resolve('cartype'); | ||
}; | ||
ConfigKeeper.servicesByPath['/buckets'].methods.method2 = fn; | ||
@@ -272,6 +277,2 @@ request({ | ||
}, (error, httpResp, body) => { | ||
expect(fn.mock.calls[0][0] instanceof Car_type_1.CarType); | ||
expect(fn.mock.calls[0][1] instanceof http_1.IncomingMessage); | ||
expect(fn.mock.calls[0][2] instanceof http_1.ServerResponse); | ||
done(); | ||
}); | ||
@@ -295,4 +296,3 @@ }); | ||
expect(fn.mock.calls[0][1] instanceof Engine_type_1.EngineType); | ||
expect(fn.mock.calls[0][2] instanceof http_1.IncomingMessage); | ||
expect(fn.mock.calls[0][3] instanceof http_1.ServerResponse); | ||
expect(fn.mock.calls[0][2] instanceof RequestContext_type_1.RequestContextType); | ||
done(); | ||
@@ -299,0 +299,0 @@ }); |
{ | ||
"name": "@pawsteam/ts-jsonrpc-server", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "A framework for easily building JSONRPC simple servers in TS", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3
147694