diff --git a/test/transforms/compressJavaScript.js b/test/transforms/compressJavaScript.js index 046c104f10..b9dbac0e63 100644 --- a/test/transforms/compressJavaScript.js +++ b/test/transforms/compressJavaScript.js @@ -27,21 +27,20 @@ describe('transforms/compressJavaScript', function () { }); } - it('should warn when UglifyJS runs into a parse error and leave the asset unchanged', async function () { + it.only('should warn when UglifyJS runs into a parse error and leave the asset unchanged', async function () { const warnSpy = sinon.spy().named('warn'); const assetGraph = new AssetGraph(); assetGraph.on('warn', warnSpy); - assetGraph.addAsset({ + const a = 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)' ) ); }); @@ -49,7 +48,7 @@ describe('transforms/compressJavaScript', function () { expect( assetGraph.findAssets({ type: 'JavaScript' })[0].text, 'to equal', - 'var foo = `123`;' + 'foo?.bar' ); });