fix(core): update
This commit is contained in:
parent
aef1e6183c
commit
3667946b2f
1173
package-lock.json
generated
1173
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -15,6 +15,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.0.22",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.15",
|
||||||
|
"@pushrocks/smartexpress": "^3.0.40",
|
||||||
"@pushrocks/tapbundle": "^3.0.13",
|
"@pushrocks/tapbundle": "^3.0.13",
|
||||||
"@types/node": "^12.7.2",
|
"@types/node": "^12.7.2",
|
||||||
"tslint": "^5.19.0",
|
"tslint": "^5.19.0",
|
||||||
|
27
test/test.ts
27
test/test.ts
@ -1,8 +1,29 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, tap } from '@pushrocks/tapbundle';
|
||||||
import * as typedrequest from '../ts/index';
|
import * as smartexpress from '@pushrocks/smartexpress';
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
import * as typedrequest from '../ts/index';
|
||||||
typedrequest.TypedRequest;
|
import { async } from 'rxjs/internal/scheduler/async';
|
||||||
|
|
||||||
|
let testServer: smartexpress.Server;
|
||||||
|
|
||||||
|
tap.test('should spawn a server to test with', async () => {
|
||||||
|
testServer = new smartexpress.Server({
|
||||||
|
cors: true,
|
||||||
|
forceSsl: false,
|
||||||
|
port: 3000
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should define a testHandler', async () => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should start the server', async () => {
|
||||||
|
await testServer.start();
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('should end the server', async () => {
|
||||||
|
await testServer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -16,11 +16,11 @@ export class TypedRequest<T extends plugins.typedRequestInterfaces.ITypedRequest
|
|||||||
public async fire(fireArg: T['request']): Promise<T['response']> {
|
public async fire(fireArg: T['request']): Promise<T['response']> {
|
||||||
const response = await plugins.smartrequest.request(this.urlEndPoint, {
|
const response = await plugins.smartrequest.request(this.urlEndPoint, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
requestBody: {
|
requestBody: JSON.stringify({
|
||||||
method: this.method,
|
method: this.method,
|
||||||
request: fireArg,
|
request: fireArg,
|
||||||
response: null
|
response: null
|
||||||
}
|
})
|
||||||
});
|
});
|
||||||
return response.body.response;
|
return response.body.response;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user