Skip to content

Commit

Permalink
Fix: test regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
gabidobo committed Aug 13, 2022
1 parent 4fc5425 commit 86782cf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -83,7 +83,7 @@ const getCurrentModule = () => {
url = new URL(mapping);
// eslint-disable-next-line no-empty
} catch (error) {}
if (url) {
if (url && url.protocol !== 'node:') {
module = mapping;
}
}
Expand Down
5 changes: 3 additions & 2 deletions tests/utils.js
Expand Up @@ -51,7 +51,8 @@ const expectWebWorkerCallToMatch = async ({
index = 0,
worker,
}) => {
const call = (await worker.evaluate('Sandworm.getHistory()'))[index];
const calls = await worker.evaluate('Sandworm.getHistory()');
const call = calls[index];

callExpects({call, family, method, firstArg, secondArg});
};
Expand All @@ -64,7 +65,7 @@ const loadSandwormOnWeb = async (page) => {
});
await page.addScriptTag({path: path.join(__dirname, '..', 'dist', 'index.js')});
await page.evaluate(() =>
Sandworm.init({devMode: true, loadSourceMap: false, skipTracking: true}),
Sandworm.init({devMode: true, loadSourceMaps: false, skipTracking: true}),
);
};

Expand Down
2 changes: 1 addition & 1 deletion tests/web/setup.js
Expand Up @@ -25,7 +25,7 @@ module.exports = async () => {
response.writeHead(200, {'Content-Type': 'text/javascript'});
response.end(`
${sandwormCode}
Sandworm.init({devMode:true, loadSourceMap: false});
Sandworm.init({devMode:true, loadSourceMaps: false});
`);
break;
case '/sandworm.js':
Expand Down

0 comments on commit 86782cf

Please sign in to comment.