Unverified Commit ba30381c authored by matamatanot's avatar matamatanot Committed by GitHub

Use fs.promises in test files (#12432)

parent 081c1a17
/* 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'))
......
/* 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')
......
/* 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')
......
/* 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')
......
/* 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
......
/* 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')
......
/* 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')
......
......@@ -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')
......
/* 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', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment