rsnext/test/e2e/app-dir/scss/npm-import-bad/npm-import-bad.test.ts
Tobias Koppers 92eecbfdff
Turbopack: sass support (#62717)
### What?

* upgrades turbopack for `getResolve` in webpack loaders
* add missing resolve-url-loader to turbopack for full sass support

Closes PACK-2634
2024-03-04 11:56:55 +00:00

30 lines
807 B
TypeScript

/* eslint-env jest */
import { remove } from 'fs-extra'
import { nextBuild } from 'next-test-utils'
import { join } from 'path'
// In order for the global isNextStart to be set
import 'e2e-utils'
console.log({ global })
describe('CSS Import from node_modules', () => {
;(Boolean((global as any).isNextStart) ? describe : describe.skip)(
'production only',
() => {
const appDir = __dirname
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
it('should fail the build', async () => {
const { code, stderr } = await nextBuild(appDir, [], { stderr: true })
expect(code).toBe(0)
expect(stderr).not.toMatch(/Can't resolve '[^']*?nprogress[^']*?'/)
expect(stderr).not.toMatch(/Build error occurred/)
})
}
)
})