|
3 | 3 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, |
4 | 4 | // You can obtain one at https://mozilla.org/MPL/2.0/. |
5 | 5 |
|
6 | | -const { promisify } = require('util') |
7 | | -const { readFile, writeFile } = require('fs/promises') |
8 | | -const exec = promisify(require('child_process').execFile) |
9 | | -const path = require('path') |
10 | | -const config = require('./config') |
11 | | -const { unlink } = require('fs-extra') |
12 | | -const { randomUUID } = require('crypto') |
13 | | -const { |
| 6 | +import { promisify } from 'node:util' |
| 7 | +import { readFile, writeFile } from 'fs/promises' |
| 8 | +import child_process from 'node:child_process' |
| 9 | +import path from 'path' |
| 10 | +import config from './config.js' |
| 11 | +import fs from 'fs-extra' |
| 12 | +import { randomUUID } from 'crypto' |
| 13 | +import { tmpdir } from 'os' |
| 14 | +import { |
14 | 15 | getApplicableFilters, |
15 | 16 | getTestsToRun, |
16 | 17 | gnTargetToExecutableName, |
17 | | -} = require('./testUtils') |
18 | | -const { tmpdir } = require('os') |
| 18 | +} from './testUtils.js' |
| 19 | + |
| 20 | +const exec = promisify(child_process.execFile) |
19 | 21 |
|
20 | 22 | const getTestTargets = (outDir, filters = ['//*']) => { |
21 | 23 | const { env, shell } = config.defaultOptions |
@@ -113,7 +115,7 @@ async function analyzeAffectedTests( |
113 | 115 |
|
114 | 116 | const output = await readFile(analyzeOutJson, 'utf-8').then(JSON.parse) |
115 | 117 |
|
116 | | - await Promise.all([unlink(analyzeJson), unlink(analyzeOutJson)]) |
| 118 | + await Promise.all([fs.unlink(analyzeJson), fs.unlink(analyzeOutJson)]) |
117 | 119 |
|
118 | 120 | return { |
119 | 121 | outDir, |
@@ -167,7 +169,4 @@ async function getAffectedTests(args = {}) { |
167 | 169 | return [...new Set([...affectedTests, ...testAffectedDueModifiedFilterFiles])] |
168 | 170 | } |
169 | 171 |
|
170 | | -module.exports = { |
171 | | - analyzeAffectedTests, |
172 | | - getAffectedTests, |
173 | | -} |
| 172 | +export { analyzeAffectedTests, getAffectedTests } |
0 commit comments