chore: calculate code coverage
This commit is contained in:
@@ -4,7 +4,7 @@ exports[`live-reload 1`] = `
|
||||
[
|
||||
{
|
||||
"code": "
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':<port>/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
const test = ()=>{
|
||||
return \`I'm "annoying" \${"in case we need to test \\\`string\\\` escaping."}. Hence this files \\'tries\\' to include all allowed forms of 'it'\`;
|
||||
};
|
||||
|
||||
@@ -26,6 +26,12 @@ test('live-reload', async () => {
|
||||
const code = await getCode(bundle);
|
||||
await bundle.close();// Make sure live-reload closes itself
|
||||
debugPrintOutput('live-reload',code);
|
||||
const portRE = /:[0-9]+\/livereload\.js/gi;
|
||||
for(const file of code){
|
||||
if(file.code && portRE.test(file.code)){
|
||||
file.code = file.code.replaceAll(portRE,":<port>/livereload.js"); // remove any references to a port
|
||||
}
|
||||
}
|
||||
expect(code).toMatchSnapshot();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user