Skip to content

Commit

Permalink
Turbopack build: Fix transpile-packages tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Jul 12, 2024
1 parent 2621746 commit b01d45f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
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: {
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

0 comments on commit b01d45f

Please sign in to comment.