Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): add types to tests #66724

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import {
initNextServerScript,
killApp,
} from 'next-test-utils'
import { ChildProcess } from 'child_process'

describe('required server files app router', () => {
let next: NextInstance
let server
let appPort
let server: ChildProcess
let appPort: number | string

const setupNext = async ({
nextEnv,
Expand Down Expand Up @@ -83,14 +84,17 @@ describe('required server files app router', () => {
/- Local:/,
{
...process.env,
PORT: appPort,
PORT: `${appPort}`,
},
undefined,
{
cwd: next.testDir,
}
)
appPort = `http://127.0.0.1:${appPort}`

if (process.platform === 'darwin') {
appPort = `http://127.0.0.1:${appPort}`
}
}

beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import {
waitFor,
} from 'next-test-utils'
import nodeFetch from 'node-fetch'
import { ChildProcess } from 'child_process'

describe('required server files i18n', () => {
let next: NextInstance
let server
let appPort
let server: ChildProcess
let appPort: number | string
let errors = []
let requiredFilesManifest

Expand Down Expand Up @@ -117,7 +118,7 @@ describe('required server files i18n', () => {
/- Local:/,
{
...process.env,
PORT: appPort,
PORT: `${appPort}`,
},
undefined,
{
Expand All @@ -127,7 +128,12 @@ describe('required server files i18n', () => {
},
}
)

if (process.platform === 'darwin') {
appPort = `http://127.0.0.1:${appPort}`
}
})

afterAll(async () => {
await next.destroy()
if (server) await killApp(server)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ describe('required server files app router', () => {
cwd: next.testDir,
}
)
appPort = `http://127.0.0.1:${appPort}`

if (process.platform === 'darwin') {
appPort = `http://127.0.0.1:${appPort}`
}
}

beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import {
retry,
waitFor,
} from 'next-test-utils'
import { ChildProcess } from 'child_process'

describe('required server files', () => {
let next: NextInstance
let server
let appPort
let server: ChildProcess
let appPort: number | string
let errors = []
let stderr = ''
let requiredFilesManifest
Expand Down Expand Up @@ -124,7 +125,7 @@ describe('required server files', () => {
{
...process.env,
ENV_FROM_HOST: 'FOOBAR',
PORT: appPort,
PORT: `${appPort}`,
},
undefined,
{
Expand Down Expand Up @@ -1296,7 +1297,7 @@ describe('required server files', () => {
/- Local:/,
{
...process.env,
PORT: appPort,
PORT: `${appPort}`,
},
undefined,
{
Expand Down
Loading