@@ -6,64 +6,48 @@ import {
66
77describe ( 'formatArrayToJSArray' , ( ) => {
88 it ( 'should return array as JS' , ( ) => {
9- expect (
10- formatArrayToJSArray ( [ 'plugin1()' , 'plugin2()' ] ) ,
11- ) . toMatchInlineSnapshot (
12- `
9+ expect ( formatArrayToJSArray ( [ 'plugin1()' , 'plugin2()' ] ) )
10+ . toMatchInlineSnapshot ( `
1311 "[plugin1(),
1412 plugin2()]"
15- ` ,
16- ) ;
13+ ` ) ;
1714 } ) ;
18-
1915 it ( 'should return empty array as JS for empty items' , ( ) => {
2016 expect ( formatArrayToJSArray ( [ ] ) ) . toMatchInlineSnapshot ( '"[]"' ) ;
2117 } ) ;
22-
2318 it ( 'should return undefined for undefined values' , ( ) => {
2419 expect ( formatArrayToJSArray ( undefined ) ) . toBeUndefined ( ) ;
2520 } ) ;
2621} ) ;
27-
2822describe ( 'formatArrayToLinesOfJsString' , ( ) => {
2923 it ( 'should return lines as JS' , ( ) => {
30- expect (
31- formatArrayToLinesOfJsString ( [ `import plugin from "../nx-plugin";` ] ) ,
32- ) . toMatchInlineSnapshot (
33- `
24+ expect ( formatArrayToLinesOfJsString ( [ `import plugin from "../nx-plugin";` ] ) )
25+ . toMatchInlineSnapshot ( `
3426 "import plugin from "../nx-plugin";"
35- ` ,
36- ) ;
27+ ` ) ;
3728 } ) ;
38-
3929 it ( 'should return lines as JS with normalized quotes' , ( ) => {
4030 expect (
4131 formatArrayToLinesOfJsString ( [
4232 `import { CoreConfig } from '@zod2md/models';` ,
4333 `import plugin from "../mx-plugin";` ,
4434 ] ) ,
45- ) . toMatchInlineSnapshot (
46- `
35+ ) . toMatchInlineSnapshot ( `
4736 "import { CoreConfig } from "@zod2md/models";
4837 import plugin from "../mx-plugin";"
49- ` ,
50- ) ;
38+ ` ) ;
5139 } ) ;
52-
5340 it ( 'should return undefined for empty items' , ( ) => {
5441 expect ( formatArrayToLinesOfJsString ( [ ] ) ) . toBeUndefined ( ) ;
5542 } ) ;
56-
5743 it ( 'should return undefined for nullish values' , ( ) => {
5844 expect ( formatArrayToLinesOfJsString ( ) ) . toBeUndefined ( ) ;
5945 } ) ;
6046} ) ;
61-
6247describe ( 'normalizeItemOrArray' , ( ) => {
6348 it ( 'should turn string into string array' , ( ) => {
6449 expect ( normalizeItemOrArray ( 'myPlugin()' ) ) . toStrictEqual ( [ 'myPlugin()' ] ) ;
6550 } ) ;
66-
6751 it ( 'should keep string array' , ( ) => {
6852 expect ( normalizeItemOrArray ( 'myPlugin()' ) ) . toStrictEqual ( [ 'myPlugin()' ] ) ;
6953 } ) ;
0 commit comments