mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
These tests won't ever be run in a deployed environment, so this removes `skipDeployment` so it's easier to grok which tests are intentionally disabled because they don't work when deployed.
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('turbopack-import-assertions-use', () => {
|
|
const { next, isTurbopack } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
if (!isTurbopack) {
|
|
it('should skip for webpack', () => {})
|
|
return
|
|
}
|
|
|
|
it('should apply raw loader via turbopackUse import assertion', async () => {
|
|
const $ = await next.render$('/')
|
|
expect($('#raw').text()).toBe('Hello from raw text file')
|
|
})
|
|
|
|
it('should apply replace loader with options via turbopackUse import assertion', async () => {
|
|
const $ = await next.render$('/')
|
|
expect($('#replaced').text()).toBe('Value is: turbopackUse works!')
|
|
})
|
|
|
|
it('should apply raw loader with turbopackModuleType ecmascript', async () => {
|
|
const $ = await next.render$('/')
|
|
expect($('#module-type').text()).toBe('Hello via module type')
|
|
})
|
|
|
|
it('should apply identity loader with turbopackModuleType json', async () => {
|
|
const $ = await next.render$('/')
|
|
expect($('#json-type').text()).toBe('Hello from JSON module type')
|
|
})
|
|
|
|
it('should apply identity with loader rules', async () => {
|
|
const $ = await next.render$('/')
|
|
expect($('#json-type-2').text()).toBe('Hello from JSON module type 2')
|
|
})
|
|
})
|