1 | import {assert} from 'chai';
|
2 | import {sonarwhal} from './../bin/code-assess';
|
3 | import {startServer, stopServer} from './server/server';
|
4 |
|
5 | describe('Sonarwhal tests', () => {
|
6 |
|
7 | it('should run sonarwhal.', async () => {
|
8 | startServer('index_success.html');
|
9 | const err = await sonarwhal('localhost:4321');
|
10 | await stopServer();
|
11 | assert.isNull(err);
|
12 | }).timeout(15000);
|
13 |
|
14 | it('should run sonarwhal and throw an error.', async () => {
|
15 | startServer('index_fail.html');
|
16 | const err = await sonarwhal('localhost:4321');
|
17 | await stopServer();
|
18 | assert.isNotNull(err.Error);
|
19 | }).timeout(15000);
|
20 | });
|