diff --git a/packages/core/core/test/Parcel.test.js b/packages/core/core/test/Parcel.test.js index 36b2681a5e0..fec67bc03bf 100644 --- a/packages/core/core/test/Parcel.test.js +++ b/packages/core/core/test/Parcel.test.js @@ -86,13 +86,13 @@ describe('ParcelAPI', function () { afterEach(() => workerFarm.end()); describe('parcel.unstable_transform()', () => { - it('should transforms simple file', async () => { + it('should transform simple file', async () => { let parcel = createParcel({workerFarm}); let res = await parcel.unstable_transform({ filePath: path.join(__dirname, 'fixtures/parcel/index.js'), }); let code = await res[0].getCode(); - assert(code.includes('exports.default = "test"')); + assert(code.includes(`exports.default = 'test'`)); }); it('should transform with standalone mode', async () => { @@ -103,9 +103,9 @@ describe('ParcelAPI', function () { }); let code = await res[0].getCode(); - assert(code.includes('require("./index.js")')); - assert(code.includes('new URL("index.js", "file:" + __filename);')); - assert(code.includes('import("index.js")')); + assert(code.includes(`require("./index.js")`)); + assert(code.includes(`new URL("index.js", "file:" + __filename);`)); + assert(code.includes(`import('index.js')`)); }); }); diff --git a/packages/core/integration-tests/test/cache.js b/packages/core/integration-tests/test/cache.js index d5246bccf46..610ad380477 100644 --- a/packages/core/integration-tests/test/cache.js +++ b/packages/core/integration-tests/test/cache.js @@ -5875,17 +5875,17 @@ describe('cache', function () { }, async update(b) { let res = await run(b.bundleGraph); - assert(res.includes(`let a = "a"`)); + assert(res.includes(`let a = 'a'`)); await overlayFS.writeFile( path.join(inputDir, 'src/entries/a.js'), - `export let a = "b";`, + `export let a = 'b';`, ); }, }); let res = await run(b.bundleGraph); - assert(res.includes(`let a = "b"`)); + assert(res.includes(`let a = 'b'`)); }); it('should invalidate when switching to a different packager for an inline bundle', async function () { diff --git a/packages/core/integration-tests/test/html.js b/packages/core/integration-tests/test/html.js index 9121106a27a..aa9b044765b 100644 --- a/packages/core/integration-tests/test/html.js +++ b/packages/core/integration-tests/test/html.js @@ -2689,7 +2689,7 @@ describe('html', function () { await getNextBuild(b); let html = await outputFS.readFile('/dist/index.html', 'utf8'); - assert(html.includes(`console.log("test")`)); + assert(html.includes(`console.log('test')`)); await overlayFS.writeFile( path.join(__dirname, '/html-inline-js-require/test.js'), @@ -2698,7 +2698,7 @@ describe('html', function () { await getNextBuild(b); html = await outputFS.readFile(path.join(distDir, '/index.html'), 'utf8'); - assert(html.includes(`console.log("foo")`)); + assert(html.includes(`console.log('foo')`)); }); it('should invalidate parent bundle when nested inline bundles change', async function () { diff --git a/packages/core/integration-tests/test/incremental-bundling.js b/packages/core/integration-tests/test/incremental-bundling.js index 4eacb8f4c36..0e767145fe3 100644 --- a/packages/core/integration-tests/test/incremental-bundling.js +++ b/packages/core/integration-tests/test/incremental-bundling.js @@ -90,7 +90,7 @@ console.log('adding a new console');`, result.bundleGraph.getBundles()[0].filePath, 'utf8', ); - assert(contents.includes(`console.log("adding a new console")`)); + assert(contents.includes(`console.log('adding a new console')`)); } finally { if (subscription) { await subscription.unsubscribe(); @@ -132,7 +132,7 @@ console.log('adding a new console');`, result.bundleGraph.getBundles()[0].filePath, 'utf8', ); - assert(contents.includes(`console.log("adding a new console")`)); + assert(contents.includes(`console.log('adding a new console')`)); } finally { if (subscription) { await subscription.unsubscribe(); @@ -174,7 +174,7 @@ console.log('adding a new console');`, result.bundleGraph.getBundles()[0].filePath, 'utf8', ); - assert(contents.includes(`console.log("adding a new console")`)); + assert(contents.includes(`console.log('adding a new console')`)); } finally { if (subscription) { await subscription.unsubscribe(); @@ -217,7 +217,7 @@ console.log(a); 'utf8', ); assert( - contents.includes(`console.log("index.js - updated string");`), + contents.includes(`console.log('index.js - updated string');`), ); } finally { if (subscription) { @@ -308,7 +308,7 @@ module.exports = a;`, 'utf8', ); - assert(contents.includes(`console.log("adding a new console")`)); + assert(contents.includes(`console.log('adding a new console')`)); let bundleOutput = await run(result.bundleGraph); assert.equal(bundleOutput, 'a updated'); @@ -404,7 +404,7 @@ console.log(a, 'updated');`, 'utf8', ); - assert(contents.includes(`console.log((0, _a.a), "updated");`)); + assert(contents.includes(`console.log((0, _a.a), 'updated');`)); let bundleCSS = result.bundleGraph.getBundles()[1]; assert.equal(bundleCSS.type, 'css'); @@ -504,7 +504,7 @@ console.log(a); 'utf8', ); - assert(contents.includes(`console.log("index.js", (0, _b.b));`)); + assert(contents.includes(`console.log('index.js', (0, _b.b));`)); } finally { if (subscription) { await subscription.unsubscribe(); @@ -612,7 +612,7 @@ console.log(a, b); ); assert( dynamicContent.includes(`parcelHelpers.export(exports, "b", ()=>b); -const b = "b";`), +const b = 'b';`), ); } finally { if (subscription) { diff --git a/packages/core/integration-tests/test/javascript.js b/packages/core/integration-tests/test/javascript.js index e1d9c7839f8..4f941fb5645 100644 --- a/packages/core/integration-tests/test/javascript.js +++ b/packages/core/integration-tests/test/javascript.js @@ -1109,8 +1109,8 @@ describe('javascript', function () { let main = await outputFS.readFile(b.getBundles()[0].filePath, 'utf8'); dedicated = await outputFS.readFile(dedicated.filePath, 'utf8'); shared = await outputFS.readFile(shared.filePath, 'utf8'); - assert(/new Worker(.*?, {[\n\s]+type: "module"[\n\s]+})/.test(main)); - assert(/new SharedWorker(.*?, {[\n\s]+type: "module"[\n\s]+})/.test(main)); + assert(/new Worker(.*?, {[\n\s]+type: 'module'[\n\s]+})/.test(main)); + assert(/new SharedWorker(.*?, {[\n\s]+type: 'module'[\n\s]+})/.test(main)); }); for (let shouldScopeHoist of [true, false]) { @@ -1263,8 +1263,8 @@ describe('javascript', function () { ); let main = await outputFS.readFile(b.getBundles()[0].filePath, 'utf8'); - assert(/new Worker(.*?, {[\n\s]+name: "worker"[\n\s]+})/.test(main)); - assert(/new SharedWorker(.*?, {[\n\s]+name: "shared"[\n\s]+})/.test(main)); + assert(/new Worker(.*?, {[\n\s]+name: 'worker'[\n\s]+})/.test(main)); + assert(/new SharedWorker(.*?, {[\n\s]+name: 'shared'[\n\s]+})/.test(main)); }); it('should error if importing in a worker without type: module', async function () { @@ -1463,7 +1463,7 @@ describe('javascript', function () { ]); let res = await outputFS.readFile(b.getBundles()[0].filePath, 'utf8'); - assert(res.includes(`importScripts("imported.js")`)); + assert(res.includes(`importScripts('imported.js')`)); }); it('should ignore importScripts in script workers when not passed a string literal', async function () { @@ -1509,7 +1509,7 @@ describe('javascript', function () { ]); let res = await outputFS.readFile(b.getBundles()[1].filePath, 'utf8'); - assert(res.includes(`importScripts("https://unpkg.com/parcel")`)); + assert(res.includes(`importScripts('https://unpkg.com/parcel')`)); }); it('should support bundling service-workers', async function () { @@ -1584,7 +1584,7 @@ describe('javascript', function () { let main = bundles.find(b => !b.env.isWorker()); let mainContents = await outputFS.readFile(main.filePath, 'utf8'); assert( - /navigator.serviceWorker.register\(.*?, {[\n\s]*scope: "foo"[\n\s]*}\)/.test( + /navigator.serviceWorker.register\(.*?, {[\n\s]*scope: 'foo'[\n\s]*}\)/.test( mainContents, ), ); @@ -4386,7 +4386,7 @@ describe('javascript', function () { let res = await run(b); assert.equal( res.default, - `

test

\n\n`, + `

test

\n\n`, ); }); diff --git a/packages/core/integration-tests/test/output-formats.js b/packages/core/integration-tests/test/output-formats.js index 22832c2138b..b86e43255e9 100644 --- a/packages/core/integration-tests/test/output-formats.js +++ b/packages/core/integration-tests/test/output-formats.js @@ -1060,7 +1060,7 @@ describe('output formats', function () { .find(bundle => bundle.name.startsWith('async')); assert( new RegExp( - `getBundleURL\\("[a-zA-Z0-9]+"\\) \\+ "` + + `getBundleURL\\('[a-zA-Z0-9]+'\\) \\+ "` + path.basename(asyncBundle.filePath) + '"', ).test(entry), diff --git a/packages/core/integration-tests/test/sourcemaps.js b/packages/core/integration-tests/test/sourcemaps.js index 39040fd4a4e..8e9d1ecf171 100644 --- a/packages/core/integration-tests/test/sourcemaps.js +++ b/packages/core/integration-tests/test/sourcemaps.js @@ -1258,7 +1258,7 @@ describe('sourcemaps', function () { source: input, generated: raw, str: "console.log('foo')", - generatedStr: `console.log("foo")`, + generatedStr: `console.log('foo')`, sourcePath, }); @@ -1267,7 +1267,7 @@ describe('sourcemaps', function () { source: input, generated: raw, str: "console.log('bar')", - generatedStr: `console.log("bar")`, + generatedStr: `console.log('bar')`, sourcePath, }); @@ -1276,7 +1276,7 @@ describe('sourcemaps', function () { source: input, generated: raw, str: "console.log('baz')", - generatedStr: `console.log("baz")`, + generatedStr: `console.log('baz')`, sourcePath, }); @@ -1285,7 +1285,7 @@ describe('sourcemaps', function () { source: input, generated: raw, str: "console.log('idhf')", - generatedStr: `console.log("idhf")`, + generatedStr: `console.log('idhf')`, sourcePath, }); }); @@ -1425,7 +1425,7 @@ describe('sourcemaps', function () { source: sourceContent, generated: raw, str: `foo = 'Lorem ipsum`, - generatedStr: `foo = "Lorem ipsum`, + generatedStr: `foo = 'Lorem ipsum`, sourcePath, }); }); diff --git a/packages/core/integration-tests/test/svg.js b/packages/core/integration-tests/test/svg.js index f8e2d06ad5f..6eebd2c937f 100644 --- a/packages/core/integration-tests/test/svg.js +++ b/packages/core/integration-tests/test/svg.js @@ -195,7 +195,7 @@ describe('svg', function () { ), ); assert(svg.includes('