Skip to content

Commit 14e5449

Browse files
committed
🚨 test: add unit tests for just ask regex detection
1 parent 2b08155 commit 14e5449

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import assert from 'node:assert';
2+
import { describe, it } from 'node:test';
3+
import { isAskingToAsk } from './just-ask.js';
4+
5+
describe('justAsk Regex', () => {
6+
it("should detect 'just ask' variations", () => {
7+
const testCases = [
8+
{ input: 'Anyone knows js?', expected: true },
9+
{ input: 'Somebody can help with Python?', expected: true },
10+
{ input: 'No one has experience with js?', expected: true },
11+
{ input: 'Everybody tried React?', expected: true },
12+
{ input: 'People familiar with Kubernetes?', expected: true },
13+
14+
{ input: 'I know js well.', expected: false },
15+
{ input: 'This is a question without the pattern.', expected: false },
16+
];
17+
18+
for (const { input, expected } of testCases) {
19+
const result = isAskingToAsk(input);
20+
assert.strictEqual(result, expected, `Failed for input: "${input}"`);
21+
}
22+
});
23+
});

0 commit comments

Comments
 (0)