Skip to content

Commit

Permalink
test: unexpected-error test expects non-colored output
Browse files Browse the repository at this point in the history
The assertions in unexpected-error.spec.ts expect the output being tested to not contain ANSI color codes. To ensure that is always the case, set FORCE_COLOR="0" so node doesn't output colors.

Without this change, this test will pass or fail depending upon the terminal being used to run the tests. With this change, the test runs consistently.
  • Loading branch information
candrews committed Aug 25, 2023
1 parent bc717ba commit c2c701c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/jest/unit/lib/unexpected-error.spec.ts
Expand Up @@ -15,7 +15,8 @@ import { getFixturePath } from '../../util/getFixturePath';
describe('callHandlingUnexpectedErrors', () => {
async function runScript(filename: string) {
const file = path.resolve(getFixturePath('unexpected-error'), filename);
return runCommand('node', ['-r', 'ts-node/register', file]);
const options = { env: { FORCE_COLOR: "0" } };
return runCommand('node', ['-r', 'ts-node/register', file], options);
}

it('calls the provided callable', async () => {
Expand Down

0 comments on commit c2c701c

Please sign in to comment.