Skip to content

Commit

Permalink
fix(tests): extract transformed data from body key
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Oct 4, 2019
1 parent ca4419d commit 6d5ed93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/controller/TestEchoController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ describeLeaks('echo controller', async () => {
const msg = 'hello world';
module.bind('test-transform').toInstance(ineeda<Transform>({
check: () => Promise.resolve(true),
transform: (c: Command, type: string, data: object) => Promise.resolve(msg),
transform: (c: Command, type: string, data: object) => Promise.resolve({
body: [msg],
}),
}));

const sendMessage = spy();
Expand Down
4 changes: 3 additions & 1 deletion test/controller/TestWeatherController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ describeLeaks('weather controller', async () => {
module.bind(INJECT_BOT).toInstance(bot);
module.bind('test-transform').toInstance(ineeda<Transform>({
check: () => Promise.resolve(true),
transform: (txCmd: Command, type: string, txData: typeof data) => Promise.resolve(txData.test),
transform: (txCmd: Command, type: string, txData: typeof data) => Promise.resolve({
body: [txData.test],
}),
}));

const controller = await createService(container, WeatherController, {
Expand Down

0 comments on commit 6d5ed93

Please sign in to comment.