Skip to content

Commit

Permalink
fix annoying test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Nov 21, 2017
1 parent 0a4aea3 commit b5821b8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/sourcemaps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ describe("sourcemaps", () => {
cascade: config.cascade
});

const _code = code.replace(/Svelte v\d+\.\d+\.\d+/, match => match.replace(/\d/g, 'x'));

fs.writeFileSync(
`${outputFilename}.js`,
`${code}\n//# sourceMappingURL=output.js.map`
`${_code}\n//# sourceMappingURL=output.js.map`
);
fs.writeFileSync(
`${outputFilename}.js.map`,
Expand All @@ -62,12 +64,12 @@ describe("sourcemaps", () => {
const locateInSource = getLocator(input);

const smc = new SourceMapConsumer(map);
const locateInGenerated = getLocator(code);
const locateInGenerated = getLocator(_code);

const smcCss = cssMap && new SourceMapConsumer(cssMap);
const locateInGeneratedCss = getLocator(css || '');

test({ assert, code, map, smc, smcCss, locateInSource, locateInGenerated, locateInGeneratedCss });
test({ assert, code: _code, map, smc, smcCss, locateInSource, locateInGenerated, locateInGeneratedCss });
});
});
});

0 comments on commit b5821b8

Please sign in to comment.