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
ba30381c
Unverified
Commit
ba30381c
authored
May 04, 2020
by
matamatanot
Committed by
GitHub
May 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use fs.promises in test files (#12432)
parent
081c1a17
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
37 deletions
+18
-37
index.test.js
test/integration/amp-export-validation/test/index.test.js
+2
-4
index.test.js
...egration/export-default-map-serverless/test/index.test.js
+2
-4
index.test.js
test/integration/export-default-map/test/index.test.js
+2
-4
index.test.js
test/integration/export-override-404/test/index.test.js
+2
-3
index.test.js
test/integration/export-serverless/test/index.test.js
+2
-5
index.test.js
...tegration/export-subfolders-serverless/test/index.test.js
+2
-4
index.test.js
test/integration/export-subfolders/test/index.test.js
+2
-4
index.test.js
test/integration/export/test/index.test.js
+2
-5
process-env.js
test/integration/production/test/process-env.js
+2
-4
No files found.
test/integration/amp-export-validation/test/index.test.js
View file @
ba30381c
/* eslint-env jest */
/* global jasmine */
import
fs
from
'fs'
import
{
promises
}
from
'fs'
import
{
join
}
from
'path'
import
{
promisify
}
from
'util'
import
{
validateAMP
}
from
'amp-test-utils'
import
{
File
,
nextBuild
,
nextExport
,
runNextCommand
}
from
'next-test-utils'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
2
const
access
=
promisify
(
fs
.
access
)
const
readFile
=
promisify
(
fs
.
readFile
)
const
{
access
,
readFile
}
=
promises
const
appDir
=
join
(
__dirname
,
'../'
)
const
outDir
=
join
(
appDir
,
'out'
)
const
nextConfig
=
new
File
(
join
(
appDir
,
'next.config.js'
))
...
...
test/integration/export-default-map-serverless/test/index.test.js
View file @
ba30381c
/* eslint-env jest */
/* global jasmine */
import
fs
from
'fs'
import
{
promises
}
from
'fs'
import
{
join
}
from
'path'
import
cheerio
from
'cheerio'
import
{
promisify
}
from
'util'
import
{
nextBuild
,
nextExport
}
from
'next-test-utils'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
5
const
readFile
=
promisify
(
fs
.
readFile
)
const
access
=
promisify
(
fs
.
access
)
const
{
access
,
readFile
}
=
promises
const
appDir
=
join
(
__dirname
,
'../'
)
const
outdir
=
join
(
appDir
,
'out'
)
...
...
test/integration/export-default-map/test/index.test.js
View file @
ba30381c
/* eslint-env jest */
/* global jasmine */
import
fs
from
'fs'
import
{
promises
}
from
'fs'
import
{
join
}
from
'path'
import
cheerio
from
'cheerio'
import
{
promisify
}
from
'util'
import
{
nextBuild
,
nextExport
}
from
'next-test-utils'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
5
const
readFile
=
promisify
(
fs
.
readFile
)
const
access
=
promisify
(
fs
.
access
)
const
{
access
,
readFile
}
=
promises
const
appDir
=
join
(
__dirname
,
'../'
)
const
outdir
=
join
(
appDir
,
'out'
)
...
...
test/integration/export-override-404/test/index.test.js
View file @
ba30381c
/* eslint-env jest */
/* global jasmine */
import
fs
from
'fs'
import
{
promises
}
from
'fs'
import
{
join
}
from
'path'
import
{
promisify
}
from
'util'
import
{
nextBuild
,
nextExport
}
from
'next-test-utils'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
5
const
readFile
=
promisify
(
fs
.
readFile
)
const
{
readFile
}
=
promises
const
appDir
=
join
(
__dirname
,
'../'
)
const
outdir
=
join
(
appDir
,
'out'
)
...
...
test/integration/export-serverless/test/index.test.js
View file @
ba30381c
/* eslint-env jest */
/* global jasmine */
import
{
join
}
from
'path'
import
{
promises
}
from
'fs'
import
{
nextBuild
,
nextExport
,
...
...
@@ -16,16 +17,12 @@ import {
import
ssr
from
'./ssr'
import
browser
from
'./browser'
import
dev
from
'./dev'
import
{
promisify
}
from
'util'
import
fs
from
'fs'
import
dynamic
from
'./dynamic'
import
apiRoutes
from
'./api-routes'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
5
const
writeFile
=
promisify
(
fs
.
writeFile
)
const
mkdir
=
promisify
(
fs
.
mkdir
)
const
access
=
promisify
(
fs
.
access
)
const
{
access
,
mkdir
,
writeFile
}
=
promises
const
appDir
=
join
(
__dirname
,
'../'
)
const
context
=
{}
context
.
appDir
=
appDir
...
...
test/integration/export-subfolders-serverless/test/index.test.js
View file @
ba30381c
/* eslint-env jest */
/* global jasmine */
import
fs
from
'fs'
import
{
promises
}
from
'fs'
import
{
join
}
from
'path'
import
cheerio
from
'cheerio'
import
{
promisify
}
from
'util'
import
{
nextBuild
,
nextExport
}
from
'next-test-utils'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
5
const
readFile
=
promisify
(
fs
.
readFile
)
const
access
=
promisify
(
fs
.
access
)
const
{
access
,
readFile
}
=
promises
const
appDir
=
join
(
__dirname
,
'../'
)
const
outdir
=
join
(
appDir
,
'out'
)
...
...
test/integration/export-subfolders/test/index.test.js
View file @
ba30381c
/* eslint-env jest */
/* global jasmine */
import
fs
from
'fs'
import
{
promises
}
from
'fs'
import
{
join
}
from
'path'
import
cheerio
from
'cheerio'
import
{
promisify
}
from
'util'
import
{
nextBuild
,
nextExport
}
from
'next-test-utils'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
5
const
readFile
=
promisify
(
fs
.
readFile
)
const
access
=
promisify
(
fs
.
access
)
const
{
access
,
readFile
}
=
promises
const
appDir
=
join
(
__dirname
,
'../'
)
const
outdir
=
join
(
appDir
,
'out'
)
...
...
test/integration/export/test/index.test.js
View file @
ba30381c
...
...
@@ -16,16 +16,13 @@ import {
import
ssr
from
'./ssr'
import
browser
from
'./browser'
import
dev
from
'./dev'
import
{
promisify
}
from
'util'
import
fs
from
'fs'
import
{
promises
}
from
'fs'
import
dynamic
from
'./dynamic'
import
apiRoutes
from
'./api-routes'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
5
const
writeFile
=
promisify
(
fs
.
writeFile
)
const
mkdir
=
promisify
(
fs
.
mkdir
)
const
access
=
promisify
(
fs
.
access
)
const
{
access
,
mkdir
,
writeFile
}
=
promises
const
appDir
=
join
(
__dirname
,
'../'
)
const
outdir
=
join
(
appDir
,
'out'
)
const
outNoTrailSlash
=
join
(
appDir
,
'outNoTrailSlash'
)
...
...
test/integration/production/test/process-env.js
View file @
ba30381c
/* eslint-env jest */
import
webdriver
from
'next-webdriver'
import
{
readFile
}
from
'fs'
import
{
promisify
}
from
'util'
import
{
promises
}
from
'fs'
import
{
join
}
from
'path'
const
readFileAsync
=
promisify
(
readFile
)
const
readNextBuildFile
=
relativePath
=>
readFileAsync
(
join
(
__dirname
,
'../.next'
,
relativePath
),
'utf8'
)
promises
.
readFile
(
join
(
__dirname
,
'../.next'
,
relativePath
),
'utf8'
)
export
default
context
=>
{
describe
(
'process.env'
,
()
=>
{
...
...
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