Skip to content

Commit

Permalink
Fix error handling test that broke because uglify-js started supporti…
Browse files Browse the repository at this point in the history
…ng template strings
  • Loading branch information
papandreou committed Feb 8, 2021
1 parent 73afa2f commit 1547f90
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/transforms/compressJavaScript.js
Expand Up @@ -34,22 +34,21 @@ describe('transforms/compressJavaScript', function () {
assetGraph.addAsset({
url: 'https://example.com/script.js',
type: 'JavaScript',
text: 'var foo = `123`;',
text: 'foo?.bar',
});
await assetGraph.compressJavaScript({ type: 'JavaScript' }, 'uglifyJs');

expect(warnSpy, 'to have calls satisfying', function () {
warnSpy(
new errors.ParseError(
"Parse error in https://example.com/script.js\nUnexpected character '`' (line 1, column 11)"
'Parse error in https://example.com/script.js\nUnexpected token: punc «.» (line 1, column 5)'
)
);
});
expect(assetGraph, 'to contain asset', 'JavaScript');
expect(
assetGraph.findAssets({ type: 'JavaScript' })[0].text,
'to equal',
'var foo = `123`;'
'foo?.bar'
);
});

Expand Down

0 comments on commit 1547f90

Please sign in to comment.