Passed
Push — master ( 309f86...ed6a26 )
by Rafael S.
01:30
created

test/interface.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 16
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
c 1
b 0
f 0
nc 1
dl 0
loc 16
rs 10
wmc 3
mnd 0
bc 3
fnc 3
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A interface.js ➔ describe(ꞌinterfaceꞌ) 0 14 1
1
var assert = require('assert');
2
3
describe('interface', function() {
4
    
5
    let byteData = require('../index.js');
6
7
    it('should find the "ab" among the junk', function() {
8
        let index = byteData.findString([1, 0, 1, 100, 97, 98, 2, 2, 0], "ab");
9
        assert.equal(index, 4);
10
    });
11
12
    it('should return -1 if the string is not found', function() {
13
        let index = byteData.findString([1, 0, 1, 100, 95, 98, 2, 2, 0], "ab");
14
        assert.equal(index, -1);
15
    });
16
});
17