Enhance CI configuration and documentation; add new action palette adapter
Some checks failed
CI / validate (push) Has been cancelled
Some checks failed
CI / validate (push) Has been cancelled
This commit is contained in:
24
test/unit/run-profile.test.mjs
Normal file
24
test/unit/run-profile.test.mjs
Normal file
@@ -0,0 +1,24 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { executeAndReport } from '../../scripts/run-profile.mjs';
|
||||
|
||||
test('builds the report after both passing and failing runs, preserving runner status', async () => {
|
||||
for (const code of [0, 1, 7]) {
|
||||
const events = [];
|
||||
const result = await executeAndReport(async () => { events.push('runner'); return code; }, async () => { events.push('report'); });
|
||||
assert.equal(result, code);
|
||||
assert.deepEqual(events, ['runner', 'report']);
|
||||
}
|
||||
});
|
||||
|
||||
test('attempts reporting after runner startup failure', async () => {
|
||||
let reported = false;
|
||||
assert.equal(await executeAndReport(async () => { throw new Error('spawn failed'); }, () => { reported = true; }), 1);
|
||||
assert.ok(reported);
|
||||
});
|
||||
|
||||
test('a report failure cannot convert a failed runner to success or hide its exit code', async () => {
|
||||
for (const code of [0, 7]) {
|
||||
assert.equal(await executeAndReport(async () => code, () => { throw new Error('unwritable report'); }), code || 1);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user