@@ -3,14 +3,32 @@ import { _generate_lint_script } from './scripts.js';
3
3
4
4
describe ( 'scripts' , ( ) => {
5
5
describe ( _generate_lint_script . name , ( ) => {
6
- it ( `should create lint scripts` , ( ) => {
6
+ it ( `should create ts lint scripts` , ( ) => {
7
7
const output = _generate_lint_script ( {
8
8
builder : 'esbuild' ,
9
9
languages : [ 'ts' ] ,
10
10
technologies : [ 'react' ] ,
11
11
} ) ;
12
12
expect ( output . lint ) . toMatch ( / c o n c u r r e n t l y .+ " n p m : l i n t : \* " / u) ;
13
- expect ( output [ 'lint:js' ] ) . toMatch ( / ^ e s l i n t / u) ;
13
+ expect ( output [ 'lint:js' ] ) . toMatch ( / ^ e s l i n t / u) ;
14
+ expect ( output [ 'lint:js' ] ) . toMatch ( / - - e x t / u) ;
15
+ expect (
16
+ output [ 'lint:js' ] ?. match ( / - - e x t ( \S + ) \b / u) ?. [ 1 ] ?. split ( ',' ) ,
17
+ ) . toEqual ( [ 'ts' , 'tsx' , 'json' ] ) ;
18
+ } ) ;
19
+
20
+ it ( `should create ts & js lint scripts` , ( ) => {
21
+ const output = _generate_lint_script ( {
22
+ builder : 'esbuild' ,
23
+ languages : [ 'ts' , 'js' ] ,
24
+ technologies : [ ] ,
25
+ } ) ;
26
+ expect ( output . lint ) . toMatch ( / c o n c u r r e n t l y .+ " n p m : l i n t : \* " / u) ;
27
+ expect ( output [ 'lint:js' ] ) . toMatch ( / ^ e s l i n t / u) ;
28
+ expect ( output [ 'lint:js' ] ) . toMatch ( / - - e x t / u) ;
29
+ expect (
30
+ output [ 'lint:js' ] ?. match ( / - - e x t ( \S + ) \b / u) ?. [ 1 ] ?. split ( ',' ) ,
31
+ ) . toEqual ( [ 'js' , 'ts' , 'json' ] ) ;
14
32
} ) ;
15
33
} ) ;
16
34
} ) ;
0 commit comments