Skip to content

Commit

Permalink
Merge pull request #2004 from abraham/flat
Browse files Browse the repository at this point in the history
Remove flat polyfill
  • Loading branch information
abraham authored Mar 13, 2021
2 parents 45bcfa0 + 474311c commit 55cfd9d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions features/steps/given.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Given } from 'cucumber';
import { origin } from '../support/environment';
import { flat } from '../support/utils';

Given(
'the network is {networkStatus}',
Expand All @@ -21,7 +20,7 @@ Given(
async function ({ rawTable }): Promise<void> {
// Available permissions: https://pptr.dev/#?product=Puppeteer&show=api-browsercontextoverridepermissionsorigin-permissions
const context = this.page.browserContext();
await context.overridePermissions(origin, flat(rawTable));
await context.overridePermissions(origin, rawTable.flat());
},
);

Expand Down
4 changes: 0 additions & 4 deletions features/support/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { ElementHandle, Page } from 'puppeteer';

// TODO: Update to Array.prototype.flat when moving to Node 12.
export const flat = (items: string[][]) =>
items.reduce((acc, val) => acc.concat(val), []);

export const sleep = (seconds: number) =>
new Promise(resolve => setTimeout(resolve, seconds * 1000));

Expand Down

0 comments on commit 55cfd9d

Please sign in to comment.