@@ -63,7 +63,7 @@ describe.each(cases)("Downloading %s", (version) => {
63
63
if ( version && version != "-r=latest" ) {
64
64
// if we will fetch all versions from npm registry we will be able to check latest
65
65
// for now we will skip this test for 'latest' version
66
- test ( `version ${ version } ` , async ( ) => {
66
+ test ( `Version is correct: ${ version } ` , async ( ) => {
67
67
const cssContent = await fs . readFile (
68
68
`./out/${ version } /css/main.css` ,
69
69
"utf-8"
@@ -81,17 +81,17 @@ describe.each(cases)("Downloading %s", (version) => {
81
81
} ) ;
82
82
}
83
83
84
- test ( "./out directory exists" , async ( ) => {
84
+ test ( "Target directory exists" , async ( ) => {
85
85
const outDirExists = await fs . exists ( versionFolder ( version ) ) ;
86
86
expect ( outDirExists ) . toBe ( true ) ;
87
87
} ) ;
88
88
89
- test ( "./out directory have files" , async ( ) => {
89
+ test ( "Target directory have files" , async ( ) => {
90
90
const dirContents = await fs . readdir ( versionFolder ( version ) ) ;
91
- expect ( dirContents . length ) . toBeGreaterThanOrEqual ( 5 ) ;
91
+ expect ( dirContents . length ) . toBeGreaterThanOrEqual ( 7 ) ;
92
92
} ) ;
93
93
94
- test ( "./out directory specific files" , async ( ) => {
94
+ test ( "Target directory contains specific files" , async ( ) => {
95
95
const dirContents = await fs . readdir ( versionFolder ( version ) ) ;
96
96
const check = [
97
97
"index.html" ,
@@ -104,14 +104,14 @@ describe.each(cases)("Downloading %s", (version) => {
104
104
expect ( check . length === 0 ) . toBe ( true ) ;
105
105
} ) ;
106
106
107
- test ( "Temp dir removed" , async ( ) => {
107
+ test ( "Temp directory removed" , async ( ) => {
108
108
const tempDirExists = await fs . exists ( tempDir ) ;
109
109
expect ( tempDirExists ) . toBe ( false ) ;
110
110
} ) ;
111
111
} ) ;
112
112
113
113
describe ( "Errors" , ( ) => {
114
- test ( "wrong version 6..2.3" , async ( ) => {
114
+ test ( "Wrong version 6..2.3" , async ( ) => { //maybe create test.each() for more errors scenarios
115
115
const mockExit = jest . spyOn ( process , "exit" ) . mockImplementation ( ( ) => { } ) ;
116
116
const version = "-r=6..2.3" ;
117
117
0 commit comments