Import chalk with import() syntax (#46931)

This makes code compatible with chalk v5.0.0.
This commit is contained in:
uhyo
2021-11-29 22:32:29 +09:00
committed by GitHub
parent 2e706758af
commit 04f831d795
2 changed files with 3 additions and 3 deletions

View File

@@ -1,5 +1,4 @@
// @ts-check
const chalk = require("chalk");
const { join } = require("path");
const { readFileSync } = require("fs");
try {
@@ -18,6 +17,7 @@ const playwright = require("playwright");
const debugging = false;
(async () => {
const chalk = (await import("chalk")).default;
for (const browserType of ["chromium", "firefox"]) {
const browser = await playwright[browserType].launch({ headless: !debugging });
const context = await browser.newContext();