File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments