tests/web/bull-board.test.js   A
last analyzed

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 36
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 24
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 5
mnd 0
bc 0
fnc 5
bpm 0
cpm 1
noi 0
1
import Test from '../Test';
2
import request from '../request';
3
4
const factory = new Test();
5
6
suite('Bull board #web #redis');
7
8
before(async function () {
9
    await factory.dropQueue();
10
});
11
12
test('Negative: no-auth', async function () {
13
    await request
14
        .get('/admin/bull')
15
        .expect(401)
16
        .expect('WWW-Authenticate', 'Basic realm="401"');
17
});
18
19
test('Negative: invalid creds', async function () {
20
    await request
21
        .get('/admin/bull')
22
        .auth('user', 'password')
23
        .expect(401);
24
});
25
26
test('Positive: admin creds', async function () {
27
    await request
28
        .get('/admin/bull')
29
        .auth('admin', process.env.BASIC_ADMIN_PASSWORD)
30
        .expect(200)
31
        .expect('Content-Type', 'text/html; charset=utf-8');
32
});
33
34
after(async function () {
35
    await factory.dropQueue();
36
});
37