Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbopack build: Fix transpile-packages tests #67705

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions test/e2e/transpile-packages/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import path from 'path'
import { createNext, FileRef } from 'e2e-utils'
import { NextInstance } from 'e2e-utils'
import webdriver from 'next-webdriver'
import { shouldRunTurboDevTest } from '../../lib/next-test-utils'

describe('transpile packages', () => {
let next: NextInstance
Expand All @@ -18,16 +17,6 @@ describe('transpile packages', () => {
dependencies: {
sass: 'latest',
},
packageJson: {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default so I'm not sure why it was added, maybe a legacy thing when we used yarn.

scripts: {
build: 'next build',
dev: `next ${shouldRunTurboDevTest() ? 'dev --turbo' : 'dev'}`,
start: 'next start',
},
},
installCommand: 'pnpm i',
startCommand: (global as any).isNextDev ? 'pnpm dev' : 'pnpm start',
buildCommand: 'pnpm build',
})
})
afterAll(() => next.destroy())
Expand All @@ -38,6 +27,13 @@ describe('transpile packages', () => {
return
}

// TODO: This test is failing in Turbopack
it.skip('should handle optional peer dependencies', async () => {
const browser = await webdriver(next.url, '/peer-deps')

expect(await browser.elementByCss('h1').text()).toBe('world')
})

describe('css', () => {
it('should handle global css imports inside transpiled modules', async () => {
const browser = await webdriver(next.url, '/global-css')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { hello } from 'package-with-optional-deps'

export default function Page() {
return hello()
return <h1>{hello()}</h1>
}
4 changes: 2 additions & 2 deletions test/turbopack-build-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6093,15 +6093,15 @@
"runtimeError": false
},
"test/e2e/transpile-packages/index.test.ts": {
"passed": [],
"failed": [
"passed": [
"transpile packages css should handle css modules imports inside transpiled modules",
"transpile packages css should handle global css imports inside transpiled modules",
"transpile packages css should handle global scss imports inside transpiled modules",
"transpile packages css should handle scss modules imports inside transpiled modules",
"transpile packages optional deps should hide dynammic module dependency errors from node_modules",
"transpile packages optional deps should not throw an error when optional deps are not installed"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": true
Expand Down
Loading