Unverified Commit c8b2d1b4 authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

(test only) Integration tests: remove flatMap polyfill (#56546)

This has been supported since Node 11. Remove this from our integration tests.

Test Plan: CI


Closes WEB-1735
parent 7a08f008
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { remove } from 'fs-extra' import { remove } from 'fs-extra'
import { nextBuild, File } from 'next-test-utils' import { nextBuild, File } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { readdir, readFile, remove } from 'fs-extra' import { readdir, readFile, remove } from 'fs-extra'
import { nextBuild } from 'next-test-utils' import { nextBuild } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { remove } from 'fs-extra' import { remove } from 'fs-extra'
import { import {
findPort, findPort,
......
/* eslint-env jest */ /* eslint-env jest */
import cheerio from 'cheerio' import cheerio from 'cheerio'
import 'flat-map-polyfill'
import { readdir, readFile, remove } from 'fs-extra' import { readdir, readFile, remove } from 'fs-extra'
import { import {
findPort, findPort,
......
/* eslint-env jest */ /* eslint-env jest */
import cheerio from 'cheerio' import cheerio from 'cheerio'
import 'flat-map-polyfill'
import { readdir, readFile, remove } from 'fs-extra' import { readdir, readFile, remove } from 'fs-extra'
import { import {
check, check,
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { pathExists, readFile, readJSON, remove } from 'fs-extra' import { pathExists, readFile, readJSON, remove } from 'fs-extra'
import { import {
check, check,
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { remove } from 'fs-extra' import { remove } from 'fs-extra'
import { import {
check, check,
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { readdir, readFile, remove } from 'fs-extra' import { readdir, readFile, remove } from 'fs-extra'
import { nextBuild } from 'next-test-utils' import { nextBuild } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { remove } from 'fs-extra' import { remove } from 'fs-extra'
import { nextBuild } from 'next-test-utils' import { nextBuild } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { readdir, readFile, remove } from 'fs-extra' import { readdir, readFile, remove } from 'fs-extra'
import { nextBuild } from 'next-test-utils' import { nextBuild } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
......
/* eslint-env jest */ /* eslint-env jest */
import cheerio from 'cheerio' import cheerio from 'cheerio'
import 'flat-map-polyfill'
import { readdir, readFile, remove } from 'fs-extra' import { readdir, readFile, remove } from 'fs-extra'
import { import {
File, File,
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { remove } from 'fs-extra' import { remove } from 'fs-extra'
import { import {
findPort, findPort,
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { remove } from 'fs-extra' import { remove } from 'fs-extra'
import { File, findPort, killApp, launchApp, waitFor } from 'next-test-utils' import { File, findPort, killApp, launchApp, waitFor } from 'next-test-utils'
import webdriver from 'next-webdriver' import webdriver from 'next-webdriver'
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { readdir, readFile, remove } from 'fs-extra' import { readdir, readFile, remove } from 'fs-extra'
import { nextBuild } from 'next-test-utils' import { nextBuild } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
......
/* eslint-env jest */ /* eslint-env jest */
import 'flat-map-polyfill'
import { remove } from 'fs-extra' import { remove } from 'fs-extra'
import { nextBuild } from 'next-test-utils' import { nextBuild } from 'next-test-utils'
import { join } from 'path' import { join } from 'path'
......
if (!Array.prototype.flat) {
// eslint-disable-next-line no-extend-native
Object.defineProperty(Array.prototype, 'flat', {
configurable: true,
value: function flat() {
var depth = isNaN(arguments[0]) ? 1 : Number(arguments[0])
return depth
? Array.prototype.reduce.call(
this,
function (acc, cur) {
if (Array.isArray(cur)) {
acc.push.apply(acc, flat.call(cur, depth - 1))
} else {
acc.push(cur)
}
return acc
},
[]
)
: Array.prototype.slice.call(this)
},
writable: true,
})
}
if (!Array.prototype.flatMap) {
// eslint-disable-next-line no-extend-native
Object.defineProperty(Array.prototype, 'flatMap', {
configurable: true,
value: function flatMap() {
return Array.prototype.map.apply(this, arguments).flat()
},
writable: true,
})
}
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