Skip to content

Commit

Permalink
Rename dev mode -> development mode (#63666)
Browse files Browse the repository at this point in the history
## What?

Makes it easier to find all the development specific tests. Preparation
for a follow-up that adds process.env.TURBOPACK_BUILD skip.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2912
  • Loading branch information
timneutkens authored Mar 25, 2024
1 parent b51a703 commit f3b2524
Show file tree
Hide file tree
Showing 146 changed files with 2,057 additions and 2,045 deletions.
2 changes: 1 addition & 1 deletion test/e2e/app-dir/actions/app-action-export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ createNextDescribe(
},
({ next, isNextStart }) => {
if (!isNextStart) {
it('skip test for dev mode', () => {})
it('skip test for development mode', () => {})
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ createNextDescribe(
},
({ next, isNextStart, isNextDeploy }) => {
if (!isNextStart) {
it('skip test for dev mode', () => {})
it('skip test for development mode', () => {})
return
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/app-dir/app-client-cache/client-cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ createNextDescribe(
},
({ next, isNextDev }) => {
if (isNextDev) {
// since the router behavior is different in dev mode (no viewport prefetching + liberal revalidation)
// since the router behavior is different in development mode (no viewport prefetching + liberal revalidation)
// we only check the production behavior
it('should skip dev', () => {})
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ createNextDescribe(
},
({ next, isNextDev }) => {
if (isNextDev) {
it.skip('should skip test in dev mode', () => {})
it.skip('should skip test in development mode', () => {})
} else {
it('should avoid double-fetching when optimistic navigation fails', async () => {
const browser = await next.browser('/foo')
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/app-dir/app-static/app-static.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3056,7 +3056,7 @@ createNextDescribe(
})
}
})
// Don't run these tests in dev mode since they won't be statically generated
// Don't run these tests in development mode since they won't be statically generated
if (!isDev) {
describe('server response', () => {
it('should bailout to client rendering - with suspense boundary', async () => {
Expand Down Expand Up @@ -3215,7 +3215,7 @@ createNextDescribe(
})
}
if (!process.env.CUSTOM_CACHE_HANDLER && isDev) {
it('should not cache request if response data size is greater than 2MB and FetchCache is possible in Dev mode', async () => {
it('should not cache request if response data size is greater than 2MB and FetchCache is possible in development mode', async () => {
const cliOutputStart = next.cliOutput.length
const resp1 = await next.fetch('/force-cache/large-data')
const resp1Text = await resp1.text()
Expand Down Expand Up @@ -3243,7 +3243,7 @@ createNextDescribe(
})
}
if (process.env.CUSTOM_CACHE_HANDLER && isDev) {
it('should cache request if response data size is greater than 2MB in Dev mode', async () => {
it('should cache request if response data size is greater than 2MB in development mode', async () => {
const cliOutputStart = next.cliOutput.length
const resp1 = await next.fetch('/force-cache/large-data')
const resp1Text = await resp1.text()
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/app-dir/logging/fetch-logging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ createNextDescribe(
withFullUrlFetches?: boolean
}) {
if (withFetchesLogging) {
it('should only log requests in dev mode', async () => {
it('should only log requests in development mode', async () => {
const outputIndex = next.cliOutput.length
await next.fetch('/default-cache')

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/app-dir/metadata-warnings/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ createNextDescribe(
},
({ next, isNextDev }) => {
// If it's start mode, we get the whole logs since they're from build process.
// If it's dev mode, we get the logs after request
// If it's development mode, we get the logs after request
function getCliOutput(logStartPosition: number) {
return isNextDev ? next.cliOutput.slice(logStartPosition) : next.cliOutput
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ createNextDescribe(
},
({ next, isNextDev }) => {
if (isNextDev) {
it.skip('skip test for dev mode', () => {})
it.skip('skip test for development mode', () => {})
return
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/edge-configurable-runtime/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const apiPath = 'pages/api/edge.js'
const api = new File(join(appDir, apiPath))

if ((global as any).isNextDev) {
describe('In dev mode', () => {
describe('In development mode', () => {
beforeAll(async () => {
next = await createNext({
files: new FileRef(appDir),
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/prerender.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ describe('Prerender', () => {
expect(JSON.parse($2('#__NEXT_DATA__').text()).isFallback).toBe(false)
})

it('should log error in console and browser in dev mode', async () => {
it('should log error in console and browser in development mode', async () => {
const indexPage = 'pages/index.js'
const origContent = await next.readFile(indexPage)

Expand Down
2 changes: 1 addition & 1 deletion test/integration/404-page-app/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('404 Page Support with _app', () => {
}
)

describe('dev mode', () => {
describe('development mode', () => {
let stderr = ''
let stdout = ''

Expand Down
2 changes: 1 addition & 1 deletion test/integration/404-page-custom-error/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Default 404 Page with custom _error', () => {
}
)

describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/404-page-ssg/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('404 Page Support SSG', () => {
}
)

describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
stderr = ''
Expand Down
4 changes: 2 additions & 2 deletions test/integration/404-page/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const runTests = (mode = 'server') => {
}

describe('404 Page Support', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand All @@ -79,7 +79,7 @@ describe('404 Page Support', () => {

runTests('dev')
})
describe('dev mode 2', () => {
describe('development mode 2', () => {
it('falls back to _error correctly without pages/404', async () => {
await fs.move(pages404, `${pages404}.bak`)
appPort = await findPort()
Expand Down
2 changes: 1 addition & 1 deletion test/integration/500-page/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const runTests = (mode = 'server') => {
}

describe('500 Page Support', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))
appPort = await findPort()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const appDir = join(__dirname, '../')
)

describe('development mode', () => {
it('should run in dev mode successfully', async () => {
it('should run in development mode successfully', async () => {
let stderr = ''

appPort = await findPort()
Expand Down
2 changes: 1 addition & 1 deletion test/integration/amphtml-ssg/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('AMP SSG Support', () => {
runTests()
}
)
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/amphtml/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ describe('AMP Usage', () => {
})
})

describe('AMP dev mode', () => {
describe('AMP development mode', () => {
let dynamicAppPort
let ampDynamic
let output = ''
Expand Down
2 changes: 1 addition & 1 deletion test/integration/api-support/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ function runTests(dev = false) {
expect(getPageFileFromPagesManifest(appDir, '/api/users')).toBeTruthy()
})

it('should show warning when the API resolves without ending the request in dev mode', async () => {
it('should show warning when the API resolves without ending the request in development mode', async () => {
const controller = new AbortController()
setTimeout(() => {
controller.abort()
Expand Down
2 changes: 1 addition & 1 deletion test/integration/app-tree/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const runTests = () => {
}

describe('AppTree', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/async-modules/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function runTests(dev = false) {
}

describe('Async modules', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const runTests = () => {
}

// Skip as it runs `next build`, seems that is a bug.
;(process.env.TURBOPACK ? describe.skip : describe)('dev mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('development mode', () => {
beforeAll(async () => {
// TODO: This look like a bug, `nextBuild` shouldn't be required here.
await nextBuild(appDir)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/bigint/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const runTests = () => {
}

describe('bigint API route support', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const errorRegex = /getStaticPaths was added without a getStaticProps in/

describe('Catches Missing getStaticProps', () => {
describe('development mode', () => {
it('should catch it in dev mode', async () => {
it('should catch it in development mode', async () => {
const appPort = await findPort()
const app = await launchApp(appDir, appPort)
const html = await renderViaHTTP(appPort, '/hello')
Expand Down
2 changes: 1 addition & 1 deletion test/integration/client-404/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const runTests = (isProd = false) => {
}

describe('Client 404', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
context.appPort = await findPort()
context.server = await launchApp(appDir, context.appPort)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/client-shallow-routing/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const runTests = () => {
}

describe('Client Shallow Routing', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
4 changes: 2 additions & 2 deletions test/integration/custom-error/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const customErrNo404Match =
/You have added a custom \/_error page without a custom \/404 page/

describe('Custom _error', () => {
describe('dev mode 1', () => {
describe('development mode 1', () => {
let stderr = ''

beforeAll(async () => {
Expand All @@ -50,7 +50,7 @@ describe('Custom _error', () => {
})
})

describe('dev mode 2', () => {
describe('development mode 2', () => {
let stderr = ''

beforeAll(async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/custom-page-extension/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const runTests = () => {
}

describe('Custom page extension', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/custom-routes-catchall/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const runTests = () => {
}

describe('Custom routes', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Custom routes i18n with index redirect', () => {
server.close()
})

describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/custom-routes-i18n/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ describe('Custom routes i18n', () => {
nextConfig.restore()
})

describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
4 changes: 2 additions & 2 deletions test/integration/custom-routes/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2636,7 +2636,7 @@ describe('Custom routes', () => {
await fs.writeFile(nextConfigPath, nextConfigRestoreContent)
})

describe('dev mode', () => {
describe('development mode', () => {
let nextConfigContent

beforeAll(async () => {
Expand Down Expand Up @@ -2810,7 +2810,7 @@ describe('Custom routes', () => {
})
}

describe('dev mode', () => {
describe('development mode', () => {
runSoloTests(true)
})
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/custom-server/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe.each([
describe('Error when rendering without starting slash', () => {
afterEach(() => killApp(server))

it('should warn in dev mode', async () => {
it('should warn in development mode', async () => {
let stderr = ''
await startServer(
{},
Expand Down
2 changes: 1 addition & 1 deletion test/integration/data-fetching-errors/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('GS(S)P Page Errors', () => {
})
afterAll(() => fs.writeFile(indexPage, origIndexPage))

describe('dev mode', () => {
describe('development mode', () => {
runTests(true)
})
;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/disable-js/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('disabled runtime JS', () => {
}
)

describe('dev mode', () => {
describe('development mode', () => {
let appPort
let app

Expand Down
2 changes: 1 addition & 1 deletion test/integration/dist-dir/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('distDir', () => {
)
})

describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))
await fs.remove(join(appDir, 'dist'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function runTests() {
const nextConfig = join(appDir, 'next.config.js')

describe('Dynamic Optional Routing Root Fallback', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function runTests() {
const nextConfig = join(appDir, 'next.config.js')

describe('Dynamic Optional Routing', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function runInvalidPagesTests(buildFn) {
}

describe('Dynamic Optional Routing', () => {
describe('dev mode', () => {
describe('development mode', () => {
beforeAll(async () => {
appPort = await findPort()
app = await launchApp(appDir, appPort)
Expand Down
Loading

0 comments on commit f3b2524

Please sign in to comment.