Skip to content

Commit

Permalink
feat: テストの引数検証を前テストに適用
Browse files Browse the repository at this point in the history
  • Loading branch information
raiga0310_arch committed May 5, 2022
1 parent 8685ebd commit cc079c5
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/service/s**t-the-f**k-up.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ test('use case of stfu', async () => {
});

test('delete message', async () => {
const sheriff: Sheriff = {
executeMessage(channel, historyRange) {
console.log(channel, historyRange);
return Promise.resolve();
}
};
const executeMessage = jest.fn<Promise<void>, [Snowflake, number]>(() =>
Promise.resolve()
);
const sheriff: Sheriff = { executeMessage };
const responder = new SheriffCommand(sheriff);
const fn = jest.fn();
await responder.on(
Expand All @@ -45,12 +43,10 @@ test('delete message', async () => {
});

test('other command', async () => {
const sheriff: Sheriff = {
executeMessage(channel, historyRange) {
console.log(channel, historyRange);
return Promise.resolve();
}
};
const executeMessage = jest.fn<Promise<void>, [Snowflake, number]>(() =>
Promise.resolve()
);
const sheriff: Sheriff = { executeMessage };
const responder = new SheriffCommand(sheriff);
const fn = jest.fn();
await responder.on(
Expand Down

0 comments on commit cc079c5

Please sign in to comment.