Skip to content

Commit

Permalink
Turbopack build: Skip experimental.esmExternals tests (#67901)
Browse files Browse the repository at this point in the history
As of right now we're not planning to implement this experimental
feature. So skipping the tests for it for Turbopack build.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
  • Loading branch information
timneutkens authored Jul 18, 2024
1 parent fefe698 commit 669bd05
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
2 changes: 2 additions & 0 deletions docs/04-architecture/turbopack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ These features are currently not supported:
- We are planning to implement this in the future.
- `experimental.sri.algorithm`
- We are planning to implement this in the future.
- `experimental.esmExternals`
- We are currently not planning to support the legacy esmExternals configuration in Next.js with Turbopack.
- [AMP](/docs/pages/building-your-application/configuring/amp).
- We are currently not planning to support AMP in Next.js with Turbopack.
- Yarn PnP
Expand Down
60 changes: 31 additions & 29 deletions test/integration/externals-esm-loose/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,38 @@ import {
const appDir = join(__dirname, '../')
let appPort
let app
;(process.env.TURBOPACK ? describe.skip : describe)(
"Handle ESM externals with esmExternals: 'loose'",
() => {
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode',
() => {
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))
await nextBuild(appDir)
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterAll(() => killApp(app))

describe("Handle ESM externals with esmExternals: 'loose'", () => {
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode',
() => {
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))
await nextBuild(appDir)
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterAll(() => killApp(app))
const expected =
/Hello <!-- -->World<!-- -->\+<!-- -->World<!-- -->\+<!-- -->World/

const expected =
/Hello <!-- -->World<!-- -->\+<!-- -->World<!-- -->\+<!-- -->World/
it('should render the static page', async () => {
const html = await renderViaHTTP(appPort, '/static')
expect(html).toMatch(expected)
})

it('should render the static page', async () => {
const html = await renderViaHTTP(appPort, '/static')
expect(html).toMatch(expected)
})
it('should render the ssr page', async () => {
const html = await renderViaHTTP(appPort, '/ssr')
expect(html).toMatch(expected)
})

it('should render the ssr page', async () => {
const html = await renderViaHTTP(appPort, '/ssr')
expect(html).toMatch(expected)
})

it('should render the ssg page', async () => {
const html = await renderViaHTTP(appPort, '/ssg')
expect(html).toMatch(expected)
})
}
)
})
it('should render the ssg page', async () => {
const html = await renderViaHTTP(appPort, '/ssg')
expect(html).toMatch(expected)
})
}
)
}
)
4 changes: 2 additions & 2 deletions test/turbopack-build-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9260,12 +9260,12 @@
},
"test/integration/externals-esm-loose/test/index.test.js": {
"passed": [],
"failed": [
"failed": [],
"pending": [
"Handle ESM externals with esmExternals: 'loose' production mode should render the ssg page",
"Handle ESM externals with esmExternals: 'loose' production mode should render the ssr page",
"Handle ESM externals with esmExternals: 'loose' production mode should render the static page"
],
"pending": [],
"flakey": [],
"runtimeError": false
},
Expand Down

0 comments on commit 669bd05

Please sign in to comment.