Skip to content

Commit

Permalink
Support limited consoles in test/reporters.js.
Browse files Browse the repository at this point in the history
  • Loading branch information
Invader444 committed Dec 4, 2018
1 parent f0e2f4e commit 072c02e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/reporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ describe('Reporter', () => {
});

const { output } = await Lab.report(script, { reporter: 'console', progress: 0, output: false, assert: false });
expect(output).to.match(/^\u001b\[32m1 tests complete\u001b\[0m\nTest duration: \d+ ms\n\u001b\[32mNo global variable leaks detected\u001b\[0m\n\n$/);
expect(output).to.match(/^(\u001b\[32m)?1 tests complete(\u001b\[0m)?\nTest duration: \d+ ms\n(\u001b\[32m)?No global variable leaks detected(\u001b\[0m)?\n\n$/);
});

it('generates a report with verbose progress', async () => {
Expand All @@ -695,7 +695,7 @@ describe('Reporter', () => {
});

const { output } = await Lab.report(script, { reporter: 'console', progress: 2, output: false, assert: false });
expect(output).to.match(/^test\n \u001b\[32m[✔√]\u001b\[0m \u001b\[90m1\) works \(\d+ ms\)\u001b\[0m\n\n\n\u001b\[32m1 tests complete\u001b\[0m\nTest duration: \d+ ms\n\u001b\[32mNo global variable leaks detected\u001b\[0m\n\n$/);
expect(output).to.match(/^test\n (\u001b\[32m)?[✔√](\u001b\[0m)? (\u001b\[90m)?1\) works \(\d+ ms\)(\u001b\[0m)?\n\n\n(\u001b\[32m)?1 tests complete(\u001b\[0m)?\nTest duration: \d+ ms\n(\u001b\[32m)?No global variable leaks detected(\u001b\[0m)?\n\n$/);
});

it('generates a report with verbose progress with experiments with same named tests', async () => {
Expand Down Expand Up @@ -763,7 +763,7 @@ describe('Reporter', () => {
});

const { output } = await Lab.report(script, { reporter: 'console', progress: 2, assert: Code, output: false });
expect(output).to.match(/^test\n \u001b\[32m[✔√]\u001b\[0m \u001b\[90m1\) works \(\d+ ms and \d+ assertions\)\u001b\[0m\n\n\n\u001b\[32m1 tests complete\u001b\[0m\nTest duration: \d+ ms\nAssertions count\: \d+ \(verbosity\: \d+\.\d+\)\n\u001b\[32mNo global variable leaks detected\u001b\[0m\n\n$/);
expect(output).to.match(/^test\n (\u001b\[32m)?[✔√](\u001b\[0m)? (\u001b\[90m)?1\) works \(\d+ ms and \d+ assertions\)(\u001b\[0m)?\n\n\n(\u001b\[32m)?1 tests complete(\u001b\[0m)?\nTest duration: \d+ ms\nAssertions count\: \d+ \(verbosity\: \d+\.\d+\)\n(\u001b\[32m)?No global variable leaks detected(\u001b\[0m)?\n\n$/);
});

it('generates a report with verbose progress that displays well on windows', async () => {
Expand Down

0 comments on commit 072c02e

Please sign in to comment.