@@ -7,52 +7,58 @@ import {isNull} from 'lodash';
7
7
8
8
const des = process . platform === 'win32' ? describe . skip : describe ;
9
9
10
- des ( 'Compare perivous schema gen to new' , ( ) => {
11
- test . each ( [
12
- { file : 'ComplexExample.ts' } ,
13
- { file : 'Example.ts' } ,
14
- { file : 'DisjointUnionExample.ts' } ,
15
- { file : 'OmitExample.ts' } ,
16
- ] ) ( '$file' , ( tc ) => {
17
- if ( process . platform === 'win32' ) {
18
- return ;
19
- }
20
- const oldSchema = parse (
21
- [
10
+ if ( process . platform === 'win32' ) {
11
+ describe ( 'Old parse does not work on windows' , ( ) => {
12
+ test ( 'temp' , ( ) => { } ) ;
13
+ } ) ;
14
+ } else {
15
+ describe ( 'Compare perivous schema gen to new' , ( ) => {
16
+ test . each ( [
17
+ { file : 'ComplexExample.ts' } ,
18
+ { file : 'Example.ts' } ,
19
+ { file : 'DisjointUnionExample.ts' } ,
20
+ { file : 'OmitExample.ts' } ,
21
+ ] ) ( '$file' , ( tc ) => {
22
+ if ( process . platform === 'win32' ) {
23
+ return ;
24
+ }
25
+ const oldSchema = parse (
26
+ [
27
+ path . normalize (
28
+ path . posix . join (
29
+ path . posix . normalize ( __dirname ) ,
30
+ `/build-parameters/src/${ tc . file } ` ,
31
+ ) ,
32
+ ) ,
33
+ ] ,
34
+ loadTsConfig ( ) ,
35
+ ) . getAllTypes ( ) ;
36
+ const newSchema = createParser (
22
37
path . normalize (
23
38
path . posix . join (
24
39
path . posix . normalize ( __dirname ) ,
25
40
`/build-parameters/src/${ tc . file } ` ,
26
41
) ,
27
42
) ,
28
- ] ,
29
- loadTsConfig ( ) ,
30
- ) . getAllTypes ( ) ;
31
- const newSchema = createParser (
32
- path . normalize (
33
- path . posix . join (
34
- path . posix . normalize ( __dirname ) ,
35
- `/build-parameters/src/${ tc . file } ` ,
36
- ) ,
37
- ) ,
38
- loadTsConfig ( ) ,
39
- { encodeRefs : true } ,
40
- ) . getAllTypes ( ) ;
41
- expect ( oldSchema ) . toMatchSnapshot ( 'oldSchema' ) ;
42
- expect ( newSchema ) . toMatchSnapshot ( 'newSchema' ) ;
43
- const difference = diff ( oldSchema , newSchema , {
44
- aColor : ( s : string ) => s ,
45
- bColor : ( s : string ) => s ,
46
- commonColor : ( s : string ) => s ,
47
- patchColor : ( s : string ) => s ,
48
- changeColor : ( s : string ) => s ,
49
- contextLines : 3 ,
50
- } ) ;
51
- if ( isNull ( difference ) ) {
52
- fail ( ) ;
53
- }
54
- //Uncomment line to have test fail, to see the differences with color
55
- //expect(newSchema).toStrictEqual(oldSchema);
56
- expect ( difference . replaceAll ( '\r' , '' ) ) . toMatchSnapshot ( 'diff' ) ;
57
- } ) ; //
58
- } ) ;
43
+ loadTsConfig ( ) ,
44
+ { encodeRefs : true } ,
45
+ ) . getAllTypes ( ) ;
46
+ expect ( oldSchema ) . toMatchSnapshot ( 'oldSchema' ) ;
47
+ expect ( newSchema ) . toMatchSnapshot ( 'newSchema' ) ;
48
+ const difference = diff ( oldSchema , newSchema , {
49
+ aColor : ( s : string ) => s ,
50
+ bColor : ( s : string ) => s ,
51
+ commonColor : ( s : string ) => s ,
52
+ patchColor : ( s : string ) => s ,
53
+ changeColor : ( s : string ) => s ,
54
+ contextLines : 3 ,
55
+ } ) ;
56
+ if ( isNull ( difference ) ) {
57
+ fail ( ) ;
58
+ }
59
+ //Uncomment line to have test fail, to see the differences with color
60
+ //expect(newSchema).toStrictEqual(oldSchema);
61
+ expect ( difference . replaceAll ( '\r' , '' ) ) . toMatchSnapshot ( 'diff' ) ;
62
+ } ) ; //
63
+ } ) ;
64
+ }
0 commit comments