Skip to content

Commit

Permalink
tests: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Oct 11, 2020
1 parent bfce721 commit 101929d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 2 additions & 4 deletions test/build-errors/errors.test.js
Expand Up @@ -21,7 +21,7 @@ describe('errors', () => {
const json = JSON.parse(stdout);

expect(json['hash']).toBeDefined();
expect(json['errorsCount']).toBe(1);
expect(json['errors']).toHaveLength(1);
expect(json['errors'][0].message).toMatch(/Can't resolve/);
});

Expand All @@ -41,10 +41,8 @@ describe('errors', () => {

const json = JSON.parse(data);

console.log(json);

expect(json['hash']).toBeDefined();
expect(json['errorsCount']).toBe(1);
expect(json['errors']).toHaveLength(1);
expect(json['errors'][0].message).toMatch(/Can't resolve/);

done();
Expand Down
7 changes: 4 additions & 3 deletions test/build-warnings/warnings.test.js
Expand Up @@ -7,6 +7,8 @@ describe('warnings', () => {
it('should output by default', () => {
const { stdout, exitCode } = run(__dirname);

console.log(stdout);

expect(stdout).toMatch(/WARNING in/);
expect(stdout).toMatch(/Error: Can't resolve/);
expect(exitCode).toBe(0);
Expand All @@ -21,14 +23,13 @@ describe('warnings', () => {
const json = JSON.parse(stdout);

expect(json['hash']).toBeDefined();
expect(json['warningsCount']).toBe(1);
expect(json['warnings']).toHaveLength(1);
expect(json['warnings'][0].message).toMatch(/Can't resolve/);
});

it('should store json to a file', (done) => {
const { stdout, exitCode } = run(__dirname, ['--json', 'stats.json']);

console.log(stdout);
expect(stdout).toContain('stats are successfully stored as json to stats.json');
expect(exitCode).toBe(0);

Expand All @@ -43,7 +44,7 @@ describe('warnings', () => {
const json = JSON.parse(data);

expect(json['hash']).toBeDefined();
expect(json['warningsCount']).toBe(1);
expect(json['warnings']).toHaveLength(1);
expect(json['warnings'][0].message).toMatch(/Can't resolve/);

done();
Expand Down

0 comments on commit 101929d

Please sign in to comment.