Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
edb9f7a1
Unverified
Commit
edb9f7a1
authored
Apr 15, 2024
by
Sebastian Silbermann
Committed by
GitHub
Apr 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add typechecking test for all entrypoints (#64478)
parent
2be9ccb6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
0 deletions
+91
-0
typechecking.test.ts
test/production/typescript-basic/typechecking.test.ts
+28
-0
.gitignore
test/production/typescript-basic/typechecking/.gitignore
+1
-0
index.ts
test/production/typescript-basic/typechecking/index.ts
+25
-0
next-env.d.ts
test/production/typescript-basic/typechecking/next-env.d.ts
+5
-0
next.config.js
test/production/typescript-basic/typechecking/next.config.js
+6
-0
tsconfig.json
test/production/typescript-basic/typechecking/tsconfig.json
+26
-0
No files found.
test/production/typescript-basic/typechecking.test.ts
0 → 100644
View file @
edb9f7a1
import
*
as
childProcess
from
'child_process'
import
path
from
'path'
import
{
FileRef
,
nextTestSetup
}
from
'e2e-utils'
describe
(
'typechecking'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
new
FileRef
(
path
.
join
(
__dirname
,
'typechecking'
)),
skipStart
:
true
,
})
it
(
'should typecheck'
,
async
()
=>
{
const
{
status
,
stdout
}
=
childProcess
.
spawnSync
(
'pnpm'
,
[
'tsc'
,
'--project'
,
'tsconfig.json'
,
'--skipLibCheck'
,
'false'
],
{
cwd
:
next
.
testDir
,
encoding
:
'utf-8'
,
}
)
if
(
status
!==
0
)
{
// Piped output is incomplete and the format barely useable.
// Printing it as a last resort in case it's not reproducible locally.
// Best to NEXT_TEST_SKIP_CLEANUP=1 this test and run the command in the app localy.
throw
new
Error
(
'Typecheck failed:
\
n'
+
stdout
)
}
})
})
test/production/typescript-basic/typechecking/.gitignore
0 → 100644
View file @
edb9f7a1
!next-env.d.ts
\ No newline at end of file
test/production/typescript-basic/typechecking/index.ts
0 → 100644
View file @
edb9f7a1
import
'next/amp'
import
'next/app'
// FIXME
// import 'next/babel';
import
'next/cache'
import
'next/client'
import
'next/config'
import
'next/constants'
import
'next/document'
import
'next/dynamic'
import
'next/error'
import
'next/head'
import
'next/headers'
import
'next/image'
import
'next'
// TODO @jest/types is an undeclared peer dependecy
// import 'next/jest';
import
'next/link'
import
'next/navigation'
import
'next/og'
import
'next/router'
import
'next/script'
import
'next/server'
// FIXME
// import 'next/web-vitals';
test/production/typescript-basic/typechecking/next-env.d.ts
0 → 100644
View file @
edb9f7a1
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
test/production/typescript-basic/typechecking/next.config.js
0 → 100644
View file @
edb9f7a1
/**
* @type {import('next').NextConfig}
*/
const
nextConfig
=
{}
module
.
exports
=
nextConfig
test/production/typescript-basic/typechecking/tsconfig.json
0 → 100644
View file @
edb9f7a1
{
"compilerOptions"
:
{
"lib"
:
[
"dom"
,
"dom.iterable"
,
"esnext"
],
"allowJs"
:
true
,
"skipLibCheck"
:
false
,
"strict"
:
true
,
"noEmit"
:
true
,
"esModuleInterop"
:
true
,
"module"
:
"esnext"
,
"moduleResolution"
:
"bundler"
,
"resolveJsonModule"
:
true
,
"isolatedModules"
:
true
,
"jsx"
:
"preserve"
,
"incremental"
:
true
,
"plugins"
:
[
{
"name"
:
"next"
}
],
"paths"
:
{
"@/*"
:
[
"./*"
]
}
},
"include"
:
[
"next-env.d.ts"
,
"**/*.ts"
,
"**/*.tsx"
,
".next/types/**/*.ts"
],
"exclude"
:
[
"node_modules"
]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment