GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 250178...1a4cdb )
by Vladimir
33s
created

test/unit/routes/index/postStreamId.test.js   A

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 37
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
c 2
b 0
f 0
nc 1
dl 0
loc 37
rs 10
wmc 5
mnd 0
bc 4
fnc 5
bpm 0.8
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B postStreamId.test.js ➔ ??? 0 35 1
1
/** global: jest */
2
3
const router = require('./../../../../src/routes/index');
4
5
describe('Index routes.', () => {
6
  const request = {
7
    method: 'POST',
8
    url: '/testId',
9
    headers: {},
10
    connection: {
11
      socket: { remoteAddress: 'testIp' },
12
    },
13
    socket: {},
14
    body: '',
15
  };
16
17
  test('POST plain text into page with certain streamId', (done) => {
18
    request.headers = { 'x-forwarded-for': 'testIp', 'content-type': 'text/plain' };
19
    request.body = 'Test with plain text body.';
20
    const response = { status: jest.fn(), send: () => done() };
21
22
    router.handle(request, response);
23
  });
24
25
  test('POST JSON data into page with certain streamId', (done) => {
26
    request.headers = { 'content-type': 'application/json' };
27
    request.body = '{"decs": "JSON data"}';
28
    const response = { status: jest.fn(), send: jest.fn() };
29
    global.socket = {
30
      emit: (type, data) => {
31
        expect(type).toBe('log');
32
        expect(typeof data).toBe('object');
33
        done();
34
      },
35
    };
36
37
    router.handle(request, response);
38
  });
39
});
40