File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6262 "del" : " ^3.0.0" ,
6363 "eslint" : " ^5.14.1" ,
6464 "eslint-config-modular" : " ^7.0.0" ,
65+ "mkdirp" : " ^0.5.1" ,
6566 "mocha" : " ^6.0.1" ,
6667 "npm-check" : " ^5.9.0" ,
6768 "nyc" : " ^13.3.0" ,
Original file line number Diff line number Diff line change 22
33const fs = require ( "fs" ) ;
44const path = require ( "path" ) ;
5+ const mkdirp = require ( "mkdirp" ) ;
56
67const filesDir = path . resolve ( "test" , "fixtures" , "files" ) ;
78const tempDir = path . resolve ( "test" , ".tmp" ) ;
@@ -17,7 +18,12 @@ const files = module.exports = {
1718 if ( typeof contents === "object" ) {
1819 contents = JSON . stringify ( contents , null , 2 ) ;
1920 }
20- fs . writeFileSync ( path . join ( tempDir , name ) , contents ) ;
21+
22+ let filePath = path . join ( tempDir , name ) ;
23+ let dirPath = path . dirname ( filePath ) ;
24+
25+ mkdirp . sync ( dirPath ) ;
26+ fs . writeFileSync ( filePath , contents ) ;
2127 } ,
2228
2329 /**
You can’t perform that action at this time.
0 commit comments