Tidy up the tests to work with the newer packages
It's not clear to me how or if the types test was running previously, the import was just wrong!
This commit is contained in:
parent
c459131c59
commit
d3ea63fbc6
|
@ -23,7 +23,7 @@ describe('Feathers application tests', () => {
|
|||
});
|
||||
|
||||
it('starts and shows the index page', () => {
|
||||
return request(getUrl()).then(body =>
|
||||
return request(getUrl('')).then(body =>
|
||||
expect(body.indexOf('<html>')).not.toEqual(-1)
|
||||
);
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import url from 'url';
|
||||
import request from 'request-promise';
|
||||
import { HooksObject } from '@feathersjs/feathers';
|
||||
import { HooksObject, HookContext } from '@feathersjs/feathers';
|
||||
|
||||
import app from '../src/app';
|
||||
import { EventsHooks } from '../src/services/events'
|
||||
|
@ -82,12 +82,18 @@ describe('Events service tests', () => {
|
|||
});
|
||||
|
||||
describe('transformCorrelator', () => {
|
||||
const context = {
|
||||
const context: HookContext<any> = {
|
||||
data: {
|
||||
correlator: null,
|
||||
type: 'jest',
|
||||
payload: {},
|
||||
},
|
||||
app: null,
|
||||
method: null,
|
||||
params: null,
|
||||
path: null,
|
||||
service: null,
|
||||
type: null,
|
||||
};
|
||||
|
||||
it('should match the transform that the Jenkins core code uses', () => {
|
||||
|
@ -97,6 +103,7 @@ describe('Events service tests', () => {
|
|||
context.data.correlator = correlator;
|
||||
context.data.type = eventType;
|
||||
|
||||
|
||||
return expect(EventsHooks.transformCorrelator(context)).resolves.toHaveProperty('data.correlator', hashedCorrelator);
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import url from 'url';
|
|||
import request from 'request-promise';
|
||||
|
||||
import app from '../src/app';
|
||||
import types from '../src/service/types';
|
||||
import types from '../src/services/types';
|
||||
|
||||
// Offsetting a bit to ensure that we can watch and run at the same time
|
||||
const port = (app.get('port') || 3030) + 10;
|
||||
|
|
Loading…
Reference in New Issue