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
596ee9c1
Unverified
Commit
596ee9c1
authored
Nov 05, 2020
by
James George
Committed by
GitHub
Nov 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests(create-next-app): remove extraneous helper (#18833)
The helper `runStarter()` is extraneous.
parent
f78ee06f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
16 deletions
+3
-16
index.test.js
test/integration/create-next-app/index.test.js
+3
-16
No files found.
test/integration/create-next-app/index.test.js
View file @
596ee9c1
...
@@ -12,19 +12,6 @@ const run = (cwd, args, input) => {
...
@@ -12,19 +12,6 @@ const run = (cwd, args, input) => {
const
options
=
input
?
{
cwd
,
input
}
:
{
cwd
}
const
options
=
input
?
{
cwd
,
input
}
:
{
cwd
}
return
execa
(
'node'
,
[
cli
].
concat
(
args
),
options
)
return
execa
(
'node'
,
[
cli
].
concat
(
args
),
options
)
}
}
const
runStarter
=
(
cwd
,
...
args
)
=>
{
const
res
=
run
(
cwd
,
args
)
res
.
stdout
.
on
(
'data'
,
(
data
)
=>
{
const
stdout
=
data
.
toString
()
if
(
/Pick a template/
.
test
(
stdout
))
{
res
.
stdin
.
write
(
'
\
n'
)
}
})
return
res
}
async
function
usingTempDir
(
fn
,
options
)
{
async
function
usingTempDir
(
fn
,
options
)
{
const
folder
=
path
.
join
(
os
.
tmpdir
(),
Math
.
random
().
toString
(
36
).
substring
(
2
))
const
folder
=
path
.
join
(
os
.
tmpdir
(),
Math
.
random
().
toString
(
36
).
substring
(
2
))
...
@@ -46,7 +33,7 @@ describe('create next app', () => {
...
@@ -46,7 +33,7 @@ describe('create next app', () => {
expect
.
assertions
(
1
)
expect
.
assertions
(
1
)
try
{
try
{
await
run
Starter
(
cwd
,
projectName
)
await
run
(
cwd
,
[
projectName
]
)
}
catch
(
e
)
{
}
catch
(
e
)
{
// eslint-disable-next-line jest/no-try-expect
// eslint-disable-next-line jest/no-try-expect
expect
(
e
.
stdout
).
toMatch
(
/contains files that could conflict/
)
expect
(
e
.
stdout
).
toMatch
(
/contains files that could conflict/
)
...
@@ -60,7 +47,7 @@ describe('create next app', () => {
...
@@ -60,7 +47,7 @@ describe('create next app', () => {
it
(
'empty directory'
,
async
()
=>
{
it
(
'empty directory'
,
async
()
=>
{
await
usingTempDir
(
async
(
cwd
)
=>
{
await
usingTempDir
(
async
(
cwd
)
=>
{
const
projectName
=
'empty-directory'
const
projectName
=
'empty-directory'
const
res
=
await
run
Starter
(
cwd
,
projectName
)
const
res
=
await
run
(
cwd
,
[
projectName
]
)
expect
(
res
.
exitCode
).
toBe
(
0
)
expect
(
res
.
exitCode
).
toBe
(
0
)
expect
(
expect
(
...
@@ -257,7 +244,7 @@ describe('create next app', () => {
...
@@ -257,7 +244,7 @@ describe('create next app', () => {
const
projectName
=
'not-writable'
const
projectName
=
'not-writable'
expect
.
assertions
(
2
)
expect
.
assertions
(
2
)
try
{
try
{
const
res
=
await
run
Starter
(
cwd
,
projectName
)
const
res
=
await
run
(
cwd
,
[
projectName
]
)
if
(
process
.
platform
===
'win32'
)
{
if
(
process
.
platform
===
'win32'
)
{
expect
(
res
.
exitCode
).
toBe
(
0
)
expect
(
res
.
exitCode
).
toBe
(
0
)
...
...
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