chore: add --verbose to jest invocation
This commit is contained in:
Родитель
5902c05995
Коммит
744156bcdc
|
@ -9,8 +9,8 @@
|
|||
"scripts": {
|
||||
"lint": "prettier --check \"src/**/*.js\" \"tests/*.js\" \"src/e\"",
|
||||
"prettier:write": "prettier --write \"src/**/*.js\" \"tests/*.js\" \"src/e\"",
|
||||
"test": "nyc --reporter=lcov --reporter=text-summary jest --config=jest.fast.json",
|
||||
"test:all": "nyc --reporter=lcov --reporter=text-summary jest --config=jest.slow.json"
|
||||
"test": "nyc --reporter=lcov --reporter=text-summary jest --config=jest.fast.json --verbose",
|
||||
"test:all": "nyc --reporter=lcov --reporter=text-summary jest --config=jest.slow.json --verbose"
|
||||
},
|
||||
"repository": "https://github.com/electron/build-tools",
|
||||
"author": "Electron Authors",
|
||||
|
|
|
@ -35,14 +35,14 @@ function exportPatches(target) {
|
|||
{ cwd: path.resolve(root, targets[target]), stdio: 'inherit', encoding: 'utf8' },
|
||||
);
|
||||
} else {
|
||||
console.log(`${color.err} Unrecognized target ${color.cmd(target)}.`);
|
||||
console.log(
|
||||
console.error(`${color.err} Unrecognized target ${color.cmd(target)}.`);
|
||||
console.error(
|
||||
`${color.err} Supported targets: ${[...Object.keys(targets), 'all']
|
||||
.sort()
|
||||
.map(a => color.cmd(a))
|
||||
.join(', ')}`,
|
||||
);
|
||||
console.log(`${color.err} See ${color.path(patchesConfig)}`);
|
||||
console.error(`${color.err} See ${color.path(patchesConfig)}`);
|
||||
process.exit(1);
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
const createSandbox = require('./sandbox');
|
||||
|
||||
const { color } = require('../src/utils/logging');
|
||||
const path = require('path');
|
||||
|
||||
describe('e-patches', () => {
|
||||
let sandbox;
|
||||
let root;
|
||||
|
||||
beforeEach(() => {
|
||||
sandbox = createSandbox();
|
||||
root = path.resolve(sandbox.tmpdir, 'master');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -14,25 +15,36 @@ describe('e-patches', () => {
|
|||
});
|
||||
|
||||
it('correctly throws with an unrecognized target', () => {
|
||||
const badTarget = 'i-definitely-dont-exist';
|
||||
const { exitCode, stdout } = sandbox
|
||||
sandbox
|
||||
.eInitRunner()
|
||||
.root(root)
|
||||
.name('name')
|
||||
.run();
|
||||
|
||||
const { exitCode, stderr } = sandbox
|
||||
.ePatchesRunner()
|
||||
.target(badTarget)
|
||||
.target('i-definitely-dont-exist')
|
||||
.run();
|
||||
|
||||
expect(exitCode).toStrictEqual(1);
|
||||
expect(stdout).toMatch(/Unrecognized target/);
|
||||
expect(stderr).toMatch(/Unrecognized target/);
|
||||
});
|
||||
|
||||
it('correctly exports patches for a recognized target', () => {
|
||||
const knownTargets = ['chromium', 'v8', 'node', 'all'];
|
||||
sandbox
|
||||
.eInitRunner()
|
||||
.root(root)
|
||||
.name('name')
|
||||
.run();
|
||||
|
||||
for (const target of knownTargets) {
|
||||
const { exitCode } = sandbox
|
||||
for (const target of ['chromium', 'v8', 'node', 'all']) {
|
||||
const { exitCode, stderr } = sandbox
|
||||
.ePatchesRunner()
|
||||
.target(target)
|
||||
.run();
|
||||
|
||||
console.debug(stderr);
|
||||
|
||||
expect(exitCode).toStrictEqual(0);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -182,6 +182,9 @@ function eShowRunner(execOptions) {
|
|||
return o;
|
||||
}
|
||||
|
||||
// An `e patches` helper.
|
||||
// Example use: result = ePatchesRunner().target('chromium').run();
|
||||
// Returns { exitCode:number, stderr:string, stdout:string }
|
||||
function ePatchesRunner() {
|
||||
const cmd = path.resolve(buildToolsSrcDir, 'e-patches.js');
|
||||
const args = [];
|
||||
|
@ -192,13 +195,7 @@ function ePatchesRunner() {
|
|||
return o;
|
||||
},
|
||||
run: () => {
|
||||
return runSync([cmd, ...args], {
|
||||
stdio: 'pipe',
|
||||
env: {
|
||||
...process.env,
|
||||
FORCE_COLOR: '1',
|
||||
},
|
||||
});
|
||||
return runSync([cmd, ...args], { stdio: 'pipe' });
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче