File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,10 @@ const defaultTestDom = `
1717 </ul>
1818 </div>
1919 </nav>
20- `
20+ ` ;
2121
2222let headerNav ;
2323let burgerImage ;
24- let burgerIcon ;
25- let burgerXIcon ;
2624
2725/**********************
2826 * Test Helpers
Original file line number Diff line number Diff line change @@ -54,14 +54,15 @@ function getSiteData() {
5454function loadDirData ( dir , basePath = '' ) {
5555 const dirData = { } ;
5656
57- if ( ! fs . existsSync ( dir ) ) {
58- // If we called on a non-existant dir, escape
59- return dirData ;
57+ let dirItems ;
58+ try {
59+ dirItems = fs . readdirSync ( dir ) ;
60+ } catch ( error ) {
61+ return dirData ; // Directory doesn't exist or isn't readable
6062 }
6163
6264 // Loop over all items in the directory
63- const items = fs . readdirSync ( dir ) ;
64- for ( const item of items ) {
65+ for ( const item of dirItems ) {
6566 const fullPath = path . join ( dir , item ) ;
6667 const stat = fs . statSync ( fullPath ) ;
6768
You can’t perform that action at this time.
0 commit comments