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
442378d2
Unverified
Commit
442378d2
authored
Aug 05, 2022
by
JJ Kasper
Committed by
GitHub
Aug 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing escheck test (#39365)
parent
5f483b97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
23 deletions
+24
-23
index.test.ts
test/production/escheck-output/index.test.ts
+24
-23
No files found.
test/production/escheck-output/index.test.ts
View file @
442378d2
import
{
createNext
}
from
'e2e-utils'
import
{
createNext
}
from
'e2e-utils'
import
execa
from
'execa
'
import
{
NextConfig
}
from
'packages/next
'
import
{
NextInstance
}
from
'test/lib/next-modes/base'
import
{
NextInstance
}
from
'test/lib/next-modes/base'
describe
(
'ES Check default output'
,
()
=>
{
describe
(
'ES Check default output'
,
()
=>
{
let
next
:
NextInstance
let
next
:
NextInstance
afterEach
(()
=>
next
.
destroy
())
beforeAll
(
async
()
=>
{
it
(
'should pass for ES5'
,
async
()
=>
{
next
=
await
createNext
({
next
=
await
createNext
({
files
:
{
'pages/index.js'
:
'export default function Page() {}'
},
files
:
{
'pages/index.js'
:
'export default function Page() { return "hello" }'
,
},
dependencies
:
{
'es-check'
:
'7.0.0'
},
dependencies
:
{
'es-check'
:
'7.0.0'
},
packageJson
:
{
scripts
:
{
build
:
'next build && es-check es5 .next/static/**/*.js'
,
},
},
buildCommand
:
'yarn build'
,
})
})
})
afterAll
(()
=>
next
.
destroy
())
const
res
=
await
execa
(
it
(
'should pass for ES5'
,
async
()
=>
{
'pnpm'
,
expect
(
next
.
cliOutput
).
toContain
(
[
'es-check'
,
'es5'
,
'.next/static/**/*.js'
],
{
cwd
:
next
.
testDir
}
)
expect
(
res
.
stdout
).
toBe
(
'info: ES-Check: there were no ES version matching errors! 🎉'
'info: ES-Check: there were no ES version matching errors! 🎉'
)
)
})
})
it
(
'should pass for ES5 with SWC minify'
,
async
()
=>
{
it
(
'should pass for ES5 with SWC minify'
,
async
()
=>
{
next
=
await
createNext
({
await
next
.
stop
()
files
:
{
'pages/index.js'
:
'export default function Page() {}'
},
await
next
.
deleteFile
(
'.next'
)
dependencies
:
{
'es-check'
:
'7.0.0'
},
await
next
.
patchFile
(
nextConfig
:
{
swcMinify
:
true
},
'next.config.js'
,
})
`
module.exports =
${
JSON
.
stringify
({
swcMinify
:
true
}
as
NextConfig
)}
const
res
=
await
execa
(
`
'pnpm'
,
[
'es-check'
,
'es5'
,
'.next/static/**/*.js'
],
{
cwd
:
next
.
testDir
}
)
)
await
next
.
start
()
expect
(
res
.
stdout
).
toBe
(
expect
(
next
.
cliOutput
).
toContain
(
'info: ES-Check: there were no ES version matching errors! 🎉'
'info: ES-Check: there were no ES version matching errors! 🎉'
)
)
})
})
...
...
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