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

Add types as a default dependency into tests #44140

Merged
merged 4 commits into from Dec 19, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions test/e2e/app-dir/app-alias.test.ts
Expand Up @@ -5,13 +5,6 @@ createNextDescribe(
'app-dir alias handling',
{
files: path.join(__dirname, 'app-alias'),
dependencies: {
react: 'latest',
'react-dom': 'latest',
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
packageJson: {
type: 'module',
},
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/app-dir/app-edge-global.test.ts
Expand Up @@ -5,13 +5,6 @@ createNextDescribe(
'app-dir global edge configuration',
{
files: path.join(__dirname, 'app-edge-global'),
dependencies: {
react: 'latest',
'react-dom': 'latest',
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
skipDeployment: true,
},
({ next }) => {
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/app-dir/app-edge.test.ts
Expand Up @@ -6,13 +6,6 @@ createNextDescribe(
'app-dir edge SSR',
{
files: path.join(__dirname, 'app-edge'),
dependencies: {
react: 'latest',
'react-dom': 'latest',
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
skipDeployment: true,
},
({ next }) => {
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/app-dir/create-root-layout.test.ts
Expand Up @@ -218,13 +218,6 @@ describe('app-dir create root layout', () => {
path.join(__dirname, 'create-root-layout/next.config.js')
),
},
dependencies: {
react: 'latest',
'react-dom': 'latest',
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
})
})
afterAll(() => next.destroy())
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/app-dir/import.test.ts
Expand Up @@ -5,13 +5,6 @@ createNextDescribe(
'app dir imports',
{
files: path.join(__dirname, 'import'),
dependencies: {
react: 'latest',
'react-dom': 'latest',
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
},
({ next }) => {
;['js', 'jsx', 'ts', 'tsx'].forEach((ext) => {
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/app-dir/layout-params.test.ts
Expand Up @@ -5,13 +5,6 @@ createNextDescribe(
'app dir - layout params',
{
files: path.join(__dirname, './layout-params'),
dependencies: {
react: 'latest',
'react-dom': 'latest',
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
},
({ next }) => {
describe('basic params', () => {
Expand Down
Expand Up @@ -9,13 +9,6 @@ describe('app-dir navigation and querystring', () => {
beforeAll(async () => {
next = await createNext({
files: new FileRef(__dirname),
dependencies: {
react: 'latest',
'react-dom': 'latest',
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
})
})
afterAll(() => next.destroy())
Expand Down
Expand Up @@ -9,13 +9,6 @@ describe('useSelectedLayoutSegment(s)', () => {
beforeAll(async () => {
next = await createNext({
files: new FileRef(__dirname),
dependencies: {
react: 'latest',
'react-dom': 'latest',
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
})
})
afterAll(() => next.destroy())
Expand Down
5 changes: 0 additions & 5 deletions test/e2e/new-link-behavior/typescript.test.ts
Expand Up @@ -17,11 +17,6 @@ describe('New Link Behavior', () => {
'tsconfig.json': new FileRef(path.join(appDir, 'tsconfig.json')),
'next.config.js': new FileRef(path.join(appDir, 'next.config.js')),
},
dependencies: {
typescript: '*',
'@types/react': '*',
'@types/node': '*',
},
})
})
afterAll(() => next.destroy())
Expand Down
9 changes: 2 additions & 7 deletions test/e2e/test-utils-tests/basic/basic.test.ts
@@ -1,4 +1,4 @@
import { createNext, FileRef } from 'e2e-utils'
import { createNext } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base'
import { fetchViaHTTP } from 'next-test-utils'

Expand All @@ -7,12 +7,7 @@ describe('createNext', () => {

beforeAll(async () => {
next = await createNext({
files: new FileRef(__dirname),
dependencies: {
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
files: __dirname,
})
})
afterAll(() => next.destroy())
Expand Down
3 changes: 3 additions & 0 deletions test/lib/next-modes/base.ts
Expand Up @@ -129,6 +129,9 @@ export class NextInstance {
const finalDependencies = {
react: reactVersion,
'react-dom': reactVersion,
'@types/react': reactVersion,
typescript: 'latest',
'@types/node': 'latest',
...this.dependencies,
...this.packageJson?.dependencies,
}
Expand Down
3 changes: 3 additions & 0 deletions test/production/ci-missing-typescript-deps/index.test.ts
Expand Up @@ -14,6 +14,9 @@ describe('ci-missing-typescript-deps', () => {
CI: '1',
},
skipStart: true,
dependencies: {
typescript: undefined,
},
})
try {
let error
Expand Down