Skip to content

Commit

Permalink
test: syakai meme test-case
Browse files Browse the repository at this point in the history
  • Loading branch information
m2en committed Feb 7, 2023
1 parent 7a10ada commit c67ac89
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/service/command/meme/test/syakai.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { describe, expect, it } from 'vitest';

import { parseStringsOrThrow } from '../../../../adaptor/proxy/command/schema.js';
import { createMockMessage } from '../../command-message.js';
import { Meme } from '../../meme.js';

describe('meme', () => {
const responder = new Meme();

it('use case of syakai', async () => {
await responder.on(
createMockMessage(
parseStringsOrThrow(['syakai', 'Rust採用'], responder.schema),
(message) => {
expect(message).toStrictEqual({
description:
'「首相、Rust採用に否定的な考え ― 『社会が変わってしまう』」'
});
}
)
);
});

it('args null (syakai)', async () => {
await responder.on(
createMockMessage(
parseStringsOrThrow(['syakai'], responder.schema),
(message) => {
expect(message).toStrictEqual({
title: '引数が不足してるみたいだ。',
description: '極めて慎重に検討すべき課題だ'
});
}
)
);
});
});

0 comments on commit c67ac89

Please sign in to comment.