From e842769a8fb6bfed23de2ef5cc962f10a9c25bd4 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Thu, 29 Oct 2020 15:50:41 +0100 Subject: [PATCH 1/4] Add failing test. --- test/integration/async-modules/test/index.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/integration/async-modules/test/index.test.js b/test/integration/async-modules/test/index.test.js index 2e6715294322..b06c70d91b15 100644 --- a/test/integration/async-modules/test/index.test.js +++ b/test/integration/async-modules/test/index.test.js @@ -90,6 +90,7 @@ function runTests(dev = false) { if (browser) await browser.close() } }) + ;(dev ? it.skip : it)('can render async error page', async () => { let browser try { @@ -101,6 +102,18 @@ function runTests(dev = false) { if (browser) await browser.close() } }) + + ;(dev ? it.skip : it)('compiles the source to es5', async () => { + const html = await renderViaHTTP(appPort, '/') + + const appScriptMatch = html.match(/\/_next\/static\/chunks\/pages\/_app-.+?\.js/) + expect(appScriptMatch).toBeTruthy() + + const appScript = appScriptMatch[0] + const appScriptContent = await renderViaHTTP(appPort, appScript) + expect(appScriptContent).not.toMatch(/async\(\)=>/) + expect(appScriptContent).not.toMatch(/await\s/) + }) } ;(isWebpack5 ? describe : describe.skip)('Async modules', () => { From 3d972c2ab1132eb8450c60112e1f08b3a5d52f6e Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Thu, 29 Oct 2020 16:01:33 +0100 Subject: [PATCH 2/4] Fix formatting --- test/integration/async-modules/test/index.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/async-modules/test/index.test.js b/test/integration/async-modules/test/index.test.js index b06c70d91b15..5a4ba44b6f79 100644 --- a/test/integration/async-modules/test/index.test.js +++ b/test/integration/async-modules/test/index.test.js @@ -90,7 +90,6 @@ function runTests(dev = false) { if (browser) await browser.close() } }) - ;(dev ? it.skip : it)('can render async error page', async () => { let browser try { @@ -102,11 +101,12 @@ function runTests(dev = false) { if (browser) await browser.close() } }) - ;(dev ? it.skip : it)('compiles the source to es5', async () => { const html = await renderViaHTTP(appPort, '/') - const appScriptMatch = html.match(/\/_next\/static\/chunks\/pages\/_app-.+?\.js/) + const appScriptMatch = html.match( + /\/_next\/static\/chunks\/pages\/_app-.+?\.js/ + ) expect(appScriptMatch).toBeTruthy() const appScript = appScriptMatch[0] From faf1f207c4dae74ab6d533c25548e91590895a3c Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Thu, 29 Oct 2020 16:50:57 +0100 Subject: [PATCH 3/4] Try modifying the root package.json --- .github/workflows/build_test_deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 884eaaf91cf8..1302cca70dac 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -107,9 +107,9 @@ jobs: steps: - uses: actions/checkout@v2 - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - run: cat packages/next/package.json | jq '.resolutions.webpack = "^5.0.0-beta.30"' > package.json.tmp && mv package.json.tmp packages/next/package.json - - run: cat packages/next/package.json | jq '.resolutions.react = "^17.0.0-rc.1"' > package.json.tmp && mv package.json.tmp packages/next/package.json - - run: cat packages/next/package.json | jq '.resolutions."react-dom" = "^17.0.0-rc.1"' > package.json.tmp && mv package.json.tmp packages/next/package.json + - run: cat package.json | jq '.resolutions.webpack = "^5.0.0-beta.30"' > package.json.tmp && mv package.json.tmp package.json + - run: cat package.json | jq '.resolutions.react = "^17.0.0-rc.1"' > package.json.tmp && mv package.json.tmppackage.json + - run: cat package.json | jq '.resolutions."react-dom" = "^17.0.0-rc.1"' > package.json.tmp && mv package.json.tmp package.json - run: yarn install --check-files - run: node run-tests.js test/integration/production/test/index.test.js - run: node run-tests.js test/integration/basic/test/index.test.js From e274650192a30a1553578efbb7dc3ace3c44869d Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Thu, 29 Oct 2020 16:56:38 +0100 Subject: [PATCH 4/4] Fix Syntax --- .github/workflows/build_test_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 1302cca70dac..7a03285d821e 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -108,7 +108,7 @@ jobs: - uses: actions/checkout@v2 - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - run: cat package.json | jq '.resolutions.webpack = "^5.0.0-beta.30"' > package.json.tmp && mv package.json.tmp package.json - - run: cat package.json | jq '.resolutions.react = "^17.0.0-rc.1"' > package.json.tmp && mv package.json.tmppackage.json + - run: cat package.json | jq '.resolutions.react = "^17.0.0-rc.1"' > package.json.tmp && mv package.json.tmp package.json - run: cat package.json | jq '.resolutions."react-dom" = "^17.0.0-rc.1"' > package.json.tmp && mv package.json.tmp package.json - run: yarn install --check-files - run: node run-tests.js test/integration/production/test/index.test.js