1- import { describe , expect } from 'vitest' ;
2- import { Formats } from '../components/home/main/Main ' ;
1+ import { describe , expect , it } from 'vitest' ;
2+ import { Formats } from './formats ' ;
33import inputHandler from './inputHandler' ;
44
5- describe ( 'simplifies input' , ( ) => {
6- const input = ` - name: SPRING_CACHE_TYPE
5+ describe ( 'inputHandler' , ( ) => {
6+ it ( 'simplifies input' , ( ) => {
7+ const input = ` - name: SPRING_CACHE_TYPE
78 value: redis
89 - name: SPRING_REDIS_SSL
910 value: true` ;
10- expect ( inputHandler ( Formats . KUBERNETES , input ) )
11- . toStrictEqual ( { SPRING_CACHE_TYPE : 'redis' , SPRING_REDIS_SSL : 'true' } ) ;
12- } ) ;
11+ expect ( inputHandler ( Formats . KUBERNETES , input ) )
12+ . toStrictEqual ( { SPRING_CACHE_TYPE : 'redis' , SPRING_REDIS_SSL : 'true' } ) ;
13+ } ) ;
1314
14- // https://stackoverflow.com/a/21699210/1098564
15- describe ( 'simplifies input quotations' , ( ) => {
16- const input = `
15+ // https://stackoverflow.com/a/21699210/1098564
16+ it ( 'simplifies input quotations' , ( ) => {
17+ const input = `
1718 - name: SPRING_CACHE_TYPE
1819 value: redis
1920 - name: >-
@@ -30,31 +31,17 @@ describe('simplifies input quotations', () => {
3031 SPRING_REDIS_SSL3
3132 value: 'redis'` ;
3233
33- expect ( inputHandler ( Formats . KUBERNETES , input ) )
34- . toStrictEqual ( { SPRING_CACHE_TYPE : 'redis' , SPRING_REDIS_SSL : 'don\'t' , SPRING_REDIS_SSL1 : 'don\'t' , SPRING_REDIS_SSL2 : 'don\'t' , SPRING_REDIS_SSL3 : 'redis' } ) ;
35- } ) ;
36-
37- // // https://stackoverflow.com/a/21699210/1098564
38- // test('block style chomp strip', () => {
39- // const input = `
40- // - name: SOME_KEY
41- // value: >-
42- // very "long"
43- // 'string' with
44-
45- // paragraph gap, \n and
46- // spaces.
47- // `
48- // expect(inputHandler(Formats.KUBERNETES, input))
49- // .toStrictEqual({"SOME_KEY": "very \"long\" 'string' with\nparagraph gap, \\n and spaces."});
50- // });
34+ expect ( inputHandler ( Formats . KUBERNETES , input ) )
35+ . toStrictEqual ( { SPRING_CACHE_TYPE : 'redis' , SPRING_REDIS_SSL : 'don\'t' , SPRING_REDIS_SSL1 : 'don\'t' , SPRING_REDIS_SSL2 : 'don\'t' , SPRING_REDIS_SSL3 : 'redis' } ) ;
36+ } ) ;
5137
52- describe ( 'simplifies input properties quotes' , ( ) => {
53- const input = `foo-bar.baz[0]=value1
38+ it ( 'simplifies input properties quotes' , ( ) => {
39+ const input = `foo-bar.baz[0]=value1
5440foo-bar.baz[1]=value2
5541foo-bar.enabled=true
5642abcDef=value3
5743` ;
58- expect ( inputHandler ( Formats . PROPERTIES , input ) )
59- . toStrictEqual ( { 'abcDef' : 'value3' , 'foo-bar' : { baz : [ 'value1' , 'value2' ] , enabled : 'true' } } ) ;
44+ expect ( inputHandler ( Formats . PROPERTIES , input ) )
45+ . toStrictEqual ( { 'abcDef' : 'value3' , 'foo-bar' : { baz : [ 'value1' , 'value2' ] , enabled : 'true' } } ) ;
46+ } ) ;
6047} ) ;
0 commit comments