mirror of
https://github.com/hanzoai/Detox.git
synced 2026-09-24 16:55:12 +00:00
20 lines
564 B
JavaScript
20 lines
564 B
JavaScript
const TestRunnerError = require('./TestRunnerError');
|
|
|
|
describe('TestRunnerError', () => {
|
|
let error;
|
|
|
|
beforeAll(() => {
|
|
error = new TestRunnerError({ command: 'foo', code: 1, signal: 'SIGINT' });
|
|
});
|
|
|
|
it('should format an error message', () => {
|
|
expect(`${error}`).toMatch(/Command failed with exit code = 1:\nfoo/);
|
|
expect(`${error.format()}`).toMatch(/Command failed with exit code = 1:\nfoo/);
|
|
});
|
|
|
|
it('should assign properties (code, signal)', () => {
|
|
expect(error.code).toBe(1);
|
|
expect(error.signal).toBe('SIGINT');
|
|
});
|
|
});
|