Skip to content

Commit

Permalink
ci: Trying out new coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anadian committed Aug 24, 2022
1 parent b1b67a3 commit fd9d888
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
18 changes: 9 additions & 9 deletions source/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ function PackageMeta( options ){
} else{ //Path
try{
_return.filename = Path.normalize( options );
} catch(error) /* c8 ignore next */{
} catch(error) /* c8 ignore next 2 */{
return_error = new Error(`Path.normalize threw an error: ${error}`);
throw return_error;
}
try{
_return.url = URLNS.pathToFileURL( _return.filename ).href;
} catch(error) /* c8 ignore next */{
} catch(error) /* c8 ignore next 2 */{
return_error = new Error(`URLNS.pathToFileURL threw an error: ${error}`);
throw return_error;
}
Expand All @@ -81,7 +81,7 @@ function PackageMeta( options ){
}
try{
_return.dirname = Path.dirname( _return.filename );
} catch( error )/* c8 ignore next */{
} catch( error )/* c8 ignore next 2 */{
return_error = new Error( `Path.dirname threw an error: ${error}` );
throw return_error;
}
Expand Down Expand Up @@ -121,15 +121,15 @@ export default function getPackageMeta( options = {} ){
..._return.paths,
...EnvPaths( _return.name )
};
} catch(error) /* c8 ignore next */{
} catch(error) /* c8 ignore next 2 */{
return_error = new Error(`ParseJSON threw an error: ${error}`);
throw return_error;
}
} else /* c8 ignore next */{
//warn package.json not found.
}
return _return;
}, error => /* c8 ignore next */{
}, error => /* c8 ignore next 2 */{
return_error = new Error(`FileSystem.promises.readFile threw an error: ${error} ${JSON.stringify(_return)}`);
throw return_error;
} );
Expand All @@ -155,22 +155,22 @@ function getPackageMetaSync( options = {} ){
..._return.paths,
...EnvPaths( _return.name )
};
} catch(error) /* c8 ignore next */{
} catch(error) /* c8 ignore next 2 */{
return_error = new Error(`ParseJSON threw an error: ${error}`);
throw return_error;
}
} catch(error) /* c8 ignore next */{
} catch(error) /* c8 ignore next 2 */{
return_error = new Error(`FileSystem.readFileSync threw an error: ${error}`);
throw return_error;
}
} catch(error) /* c8 ignore next */{
} catch(error) /* c8 ignore next 2 */{
return_error = new Error(`Path.dirname threw an error: ${error}`);
throw return_error;
}
} else{
//warn package.json couldn't be found.
}
} catch(error) /* c8 ignore next */{
} catch(error) /* c8 ignore next 2 */{
return_error = new Error(`PkgUpNS.pkgUpSync threw an error: ${error}`);
throw return_error;
}
Expand Down
5 changes: 4 additions & 1 deletion source/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ AVA( 'FirstTest', async function(t){
url: import.meta.url
},
'./main.js',
new globalThis.URL( import.meta.url )
new globalThis.URL( import.meta.url ),
{
url: new globalThis.URL( import.meta.url )
}
];
for( var i = 0; i < test_inputs.length; i++ ){
t.log( `test: ${i}` );
Expand Down

0 comments on commit fd9d888

Please sign in to comment.