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:
R Tyler Croy 2019-06-22 08:51:55 -07:00
parent c459131c59
commit d3ea63fbc6
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
3 changed files with 11 additions and 4 deletions

View File

@ -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)
);
});

View File

@ -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);
});

View File

@ -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;