Skip to content

Commit

Permalink
Remove un-needed test dependency (vercel#32616)
Browse files Browse the repository at this point in the history
* Remove un-needed test dependency

* update test

* update compiled
  • Loading branch information
ijjk committed Jan 3, 2022
1 parent 09456cb commit c9c3183
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 44 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"async-sema": "3.0.1",
"browserslist": "4.18.1",
"cheerio": "0.22.0",
"clone": "2.1.2",
"cookie": "0.4.1",
"cors": "2.8.5",
"coveralls": "3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/compiled/ora/index.js

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions test/integration/api-body-parser/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
fetchViaHTTP,
initNextServerScript,
} from 'next-test-utils'
import clone from 'clone'
import getPort from 'get-port'

const appDir = join(__dirname, '../')
Expand Down Expand Up @@ -70,12 +69,7 @@ async function makeRequestWithInvalidContentType() {
const startServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, 'server.js')
context.appPort = appPort = await getPort()
const env = Object.assign(
{},
clone(process.env),
{ PORT: `${appPort}` },
optEnv
)
const env = Object.assign({ ...process.env }, { PORT: `${appPort}` }, optEnv)

server = await initNextServerScript(
scriptPath,
Expand Down
4 changes: 1 addition & 3 deletions test/integration/custom-server/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import webdriver from 'next-webdriver'
import { join } from 'path'
import getPort from 'get-port'
import cheerio from 'cheerio'
import clone from 'clone'
import {
initNextServerScript,
killApp,
Expand All @@ -27,8 +26,7 @@ const startServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, 'server.js')
context.appPort = appPort = await getPort()
const env = Object.assign(
{},
clone(process.env),
{ ...process.env },
{ PORT: `${appPort}`, __NEXT_TEST_MODE: 'true' },
optEnv
)
Expand Down
11 changes: 2 additions & 9 deletions test/integration/fetch-polyfill-ky-universal/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
nextBuild,
nextStart,
} from 'next-test-utils'
import clone from 'clone'

const appDir = join(__dirname, '../')
const nextConfig = join(appDir, 'next.config.js')
Expand All @@ -24,8 +23,7 @@ const startApiServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, 'api-server.js')
apiServerPort = await findPort()
const env = Object.assign(
{},
clone(process.env),
{ ...process.env },
{ PORT: `${apiServerPort}` },
optEnv
)
Expand All @@ -42,12 +40,7 @@ const startApiServer = async (optEnv = {}, opts) => {
const startServerlessServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, 'serverless-server.js')
appPort = await findPort()
const env = Object.assign(
{},
clone(process.env),
{ PORT: `${appPort}` },
optEnv
)
const env = Object.assign({ ...process.env }, { PORT: `${appPort}` }, optEnv)

return await initNextServerScript(
scriptPath,
Expand Down
11 changes: 2 additions & 9 deletions test/integration/fetch-polyfill/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
nextBuild,
nextStart,
} from 'next-test-utils'
import clone from 'clone'
import cheerio from 'cheerio'

const appDir = join(__dirname, '../')
Expand All @@ -26,8 +25,7 @@ const startApiServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, 'api-server.js')
apiServerPort = await findPort()
const env = Object.assign(
{},
clone(process.env),
{ ...process.env },
{ PORT: `${apiServerPort}` },
optEnv
)
Expand All @@ -44,12 +42,7 @@ const startApiServer = async (optEnv = {}, opts) => {
const startServerlessServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, 'serverless-server.js')
appPort = await findPort()
const env = Object.assign(
{},
clone(process.env),
{ PORT: `${appPort}` },
optEnv
)
const env = Object.assign({ ...process.env }, { PORT: `${appPort}` }, optEnv)

return await initNextServerScript(
scriptPath,
Expand Down
8 changes: 1 addition & 7 deletions test/integration/filesystempublicroutes/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
killApp,
getPageFileFromBuildManifest,
} from 'next-test-utils'
import clone from 'clone'

const appDir = join(__dirname, '../')
let appPort
Expand All @@ -19,12 +18,7 @@ const context = {}
const startServer = async (optEnv = {}) => {
const scriptPath = join(appDir, 'server.js')
context.appPort = appPort = await getPort()
const env = Object.assign(
{},
clone(process.env),
{ PORT: `${appPort}` },
optEnv
)
const env = Object.assign({ ...process.env }, { PORT: `${appPort}` }, optEnv)

server = await initNextServerScript(scriptPath, /ready on/i, env)
}
Expand Down
4 changes: 1 addition & 3 deletions test/integration/ondemand/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import WebSocket from 'ws'
import { join } from 'path'
import webdriver from 'next-webdriver'
import getPort from 'get-port'
import clone from 'clone'
import {
renderViaHTTP,
fetchViaHTTP,
Expand All @@ -24,8 +23,7 @@ const startServer = async (optEnv = {}, opts) => {
const scriptPath = join(appDir, 'server.js')
context.appPort = await getPort()
const env = Object.assign(
{},
clone(process.env),
{ ...process.env },
{ PORT: `${context.appPort}` },
optEnv
)
Expand Down
4 changes: 0 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7100,10 +7100,6 @@ clone-response@^1.0.2:
dependencies:
mimic-response "^1.0.0"

clone@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"

clone@^1.0.2:
version "1.0.4"
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
Expand Down

0 comments on commit c9c3183

Please sign in to comment.