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

interface.js ➔ describe(ꞌinterfaceꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 14
rs 9.4285

2 Functions

Rating   Name   Duplication   Size   Complexity  
A interface.js ➔ ... ➔ it(ꞌshould return -1 if the string is not foundꞌ) 0 4 1
A interface.js ➔ ... ➔ it(ꞌshould find the "ab" among the junkꞌ) 0 4 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