/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v30.1.2
scripts/cleanE2e.mjs
34 строки
1000 B
Simen Bekkhus
chore: use for..of instead of forEach (#14517)
19 сен 2023, 13:41
Не верифицирован
19 сен 2023, 13:41
5b56467
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import {dirname, normalize, resolve} from 'path'; import {fileURLToPath} from 'url'; import {glob} from 'glob'; import fs from 'graceful-fs'; const excludedModules = [ 'e2e/global-setup-node-modules/node_modules/', 'e2e/presets/cjs/node_modules/', 'e2e/presets/js/node_modules/', 'e2e/presets/js-type-module/node_modules/', 'e2e/presets/json/node_modules/', 'e2e/presets/mjs/node_modules/', 'e2e/resolve-conditions/node_modules/', 'e2e/retain-all-files/node_modules/', ].map(dir => normalize(dir)); const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), '..'); const e2eNodeModules = glob.sync('e2e/{*,*/*}/node_modules/', { absolute: true, cwd: rootDir, ignore: excludedModules, }); for (const dir of e2eNodeModules) { fs.rmSync(dir, {force: true, recursive: true}); }