@@ -10,7 +10,9 @@ const {
10
10
testSites,
11
11
testConvertSites,
12
12
testTemplateSites,
13
- plantumlGeneratedFiles,
13
+ plantumlGeneratedFilesForTestSites,
14
+ plantumlGeneratedFilesForConvertSites,
15
+ plantumlGeneratedFilesForTemplateSites,
14
16
} = require ( './testSites' ) ;
15
17
16
18
/* eslint-disable no-console */
@@ -31,38 +33,43 @@ testSites.forEach((siteName) => {
31
33
console . log ( `Running ${ siteName } tests` ) ;
32
34
try {
33
35
execSync ( `node ../../index.js build ${ siteName } ` , execOptions ) ;
34
- compare ( siteName , 'expected' , '_site' , siteName === 'test_site' ? plantumlGeneratedFiles : [ ] ) ;
36
+ const siteIgnoredFiles = plantumlGeneratedFilesForTestSites [ siteName ] ;
37
+ compare ( siteName , 'expected' , '_site' , siteIgnoredFiles ) ;
35
38
} catch ( err ) {
36
39
printFailedMessage ( err , siteName ) ;
37
40
process . exit ( 1 ) ;
38
41
}
39
42
} ) ;
40
43
41
- testConvertSites . forEach ( ( siteName ) => {
42
- console . log ( `Running ${ siteName } tests` ) ;
43
- const nonMarkBindSitePath = path . join ( siteName , 'non_markbind_site' ) ;
44
+ testConvertSites . forEach ( ( sitePath ) => {
45
+ console . log ( `Running ${ sitePath } tests` ) ;
46
+ const nonMarkBindSitePath = path . join ( sitePath , 'non_markbind_site' ) ;
47
+ const siteName = sitePath . split ( '/' ) [ 1 ] ;
44
48
try {
45
49
execSync ( `node ../../index.js init ${ nonMarkBindSitePath } -c` , execOptions ) ;
46
50
execSync ( `node ../../index.js build ${ nonMarkBindSitePath } ` , execOptions ) ;
47
- compare ( siteName , 'expected' , 'non_markbind_site/_site' ) ;
51
+ const siteIgnoredFiles = plantumlGeneratedFilesForConvertSites [ siteName ] ;
52
+ compare ( sitePath , 'expected' , 'non_markbind_site/_site' , siteIgnoredFiles ) ;
48
53
} catch ( err ) {
49
- printFailedMessage ( err , siteName ) ;
50
- cleanupConvert ( path . resolve ( __dirname , siteName ) ) ;
54
+ printFailedMessage ( err , sitePath ) ;
55
+ cleanupConvert ( path . resolve ( __dirname , sitePath ) ) ;
51
56
process . exit ( 1 ) ;
52
57
}
53
- cleanupConvert ( path . resolve ( __dirname , siteName ) ) ;
58
+ cleanupConvert ( path . resolve ( __dirname , sitePath ) ) ;
54
59
} ) ;
55
60
56
61
testTemplateSites . forEach ( ( templateAndSitePath ) => {
57
62
const flag = templateAndSitePath . split ( ',' ) [ 0 ] ;
58
63
const sitePath = templateAndSitePath . split ( ',' ) [ 1 ] ;
59
64
const siteCreationTempPath = path . join ( sitePath , 'tmp' ) ;
65
+ const siteName = sitePath . split ( '/' ) [ 1 ] ;
60
66
61
67
console . log ( `Running ${ sitePath } tests` ) ;
62
68
try {
63
69
execSync ( `node ../../index.js init ${ siteCreationTempPath } --template ${ flag } ` , execOptions ) ;
64
70
execSync ( `node ../../index.js build ${ siteCreationTempPath } ` , execOptions ) ;
65
- compare ( sitePath , 'expected' , 'tmp/_site' ) ;
71
+ const siteIgnoredFiles = plantumlGeneratedFilesForTemplateSites [ siteName ] ;
72
+ compare ( sitePath , 'expected' , 'tmp/_site' , siteIgnoredFiles ) ;
66
73
} catch ( err ) {
67
74
printFailedMessage ( err , sitePath ) ;
68
75
fs . removeSync ( path . resolve ( __dirname , siteCreationTempPath ) ) ;
0 commit comments