Skip to content

Commit

Permalink
Test lint config after first-time setup (#67146)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored and lubieowoce committed Sep 2, 2024
1 parent a40bc1f commit 442807b
Show file tree
Hide file tree
Showing 5 changed files with 580 additions and 17 deletions.
17 changes: 0 additions & 17 deletions test/integration/eslint/test/next-build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { join } from 'path'

import { nextBuild } from 'next-test-utils'

const dirFirstTimeSetup = join(__dirname, '../first-time-setup')
const dirCustomConfig = join(__dirname, '../custom-config')
const dirIgnoreDuringBuilds = join(__dirname, '../ignore-during-builds')
const dirBaseDirectories = join(__dirname, '../base-directories')
Expand All @@ -23,22 +22,6 @@ describe('Next Build', () => {
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode',
() => {
test('first time setup', async () => {
const eslintrcJson = join(dirFirstTimeSetup, '.eslintrc.json')
await fs.writeFile(eslintrcJson, '')

const { stdout, stderr } = await nextBuild(dirFirstTimeSetup, [], {
stdout: true,
stderr: true,
lint: true,
})
const output = stdout + stderr

expect(output).toContain(
'No ESLint configuration detected. Run next lint to begin setup'
)
})

test('shows warnings and errors', async () => {
const { stdout, stderr } = await nextBuild(dirCustomConfig, [], {
stdout: true,
Expand Down
7 changes: 7 additions & 0 deletions test/production/eslint/first-time-setup-ts/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Test() {
return (
<div>
<h1>Hello title</h1>
</div>
)
}
7 changes: 7 additions & 0 deletions test/production/eslint/first-time-setup/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Test() {
return (
<div>
<h1>Hello title</h1>
</div>
)
}
Loading

0 comments on commit 442807b

Please sign in to comment.