@@ -3,21 +3,20 @@ import { describe, it } from 'node:test';
33import { isAskingToAsk } from './just-ask.js' ;
44
55describe ( '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 } ,
6+ const testCases = [
7+ { input : 'Anyone knows js?' , expected : true } ,
8+ { input : 'Somebody can help with Python?' , expected : true } ,
9+ { input : 'No one has experience with js?' , expected : true } ,
10+ { input : 'Everybody tried React?' , expected : true } ,
11+ { input : 'People familiar with Kubernetes?' , expected : true } ,
1312
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 ) {
13+ { input : 'I know js well.' , expected : false } ,
14+ { input : 'This is a question without the pattern.' , expected : false } ,
15+ ] ;
16+ testCases . forEach ( ( { input , expected } ) => {
17+ it ( `should return ${ expected } for input: " ${ input } "` , ( ) => {
1918 const result = isAskingToAsk ( input ) ;
20- assert . strictEqual ( result , expected , `Failed for input: " ${ input } "` ) ;
21- }
19+ assert . strictEqual ( result , expected ) ;
20+ } ) ;
2221 } ) ;
2322} ) ;
0 commit comments