diff --git a/test/app.test.ts b/test/app.test.ts index 6b6a458..eb8e2d9 100644 --- a/test/app.test.ts +++ b/test/app.test.ts @@ -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('')).not.toEqual(-1) ); }); diff --git a/test/events.test.ts b/test/events.test.ts index 4e98745..aff1c8c 100644 --- a/test/events.test.ts +++ b/test/events.test.ts @@ -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 = { 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); }); diff --git a/test/types.test.ts b/test/types.test.ts index 16d01d3..c6f1771 100644 --- a/test/types.test.ts +++ b/test/types.test.ts @@ -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;