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.
Passed
Branch feature/parse-icls-file (b20af6)
by Cedric
01:06
created

icls-parser.spec.js ➔ describe(ꞌicls-parserꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 67

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 67
rs 9.2815

1 Function

Rating   Name   Duplication   Size   Complexity  
A icls-parser.spec.js ➔ ... ➔ describe(ꞌparseꞌ) 0 65 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
'use strict';
2
3
const expect = require('chai').expect;
4
const parser = require('../../src/lib/icls-parser')
5
6
describe('icls-parser', function () {
7
    describe('parse', function () {
8
9
        it('should return an object with the name', function () {
10
            const iclsSample = '<scheme name="Material Peacock Optimized" version="142">' +
11
                '</scheme>';
12
13
            const parsed = parser.parse(iclsSample);
14
15
            expect(parsed).to.have.property('name', 'Material Peacock Optimized');
16
            expect(parsed).to.have.property('version', 142);
17
18
        });
19
20
21
        it('should return an object with the first level options', function () {
22
            const iclsSample = '<scheme name="Material Peacock Optimized" version="142">' +
23
                '  <option name="FONT_SCALE" value="1.0" />' +
24
                '  <option name="LINE_SPACING" value="1.2" />' +
25
                '  <option name="EDITOR_FONT_SIZE" value="12" />' +
26
                '  <option name="EDITOR_FONT_NAME" value="Fira Code" />' +
27
                '  <option name="EDITOR_LIGATURES" value="true" />' +
28
                '  <option name="CONSOLE_FONT_NAME" value="Menlo" />' +
29
                '  <option name="CONSOLE_LINE_SPACING" value="1.4" />' +
30
                '</scheme>';
31
32
            const parsed = parser.parse(iclsSample);
33
34
            expect(parsed).to.have.property('name', 'Material Peacock Optimized');
35
            expect(parsed).to.have.property('version', 142);
36
            expect(parsed).to.have.property('font_scale', 1.0);
37
            expect(parsed).to.have.property('line_spacing', 1.2);
38
            expect(parsed).to.have.property('editor_font_size', 12);
39
            expect(parsed).to.have.property('editor_font_name', 'Fira Code');
40
            expect(parsed).to.have.property('editor_ligatures', true);
41
            expect(parsed).to.have.property('console_font_name', 'Menlo');
42
            expect(parsed).to.have.property('console_line_spacing', 1.4);
43
44
        });
45
46
47
        it('should return an object with the colors', function () {
48
            const iclsSample = '<scheme>' +
49
                '  <colors>' +
50
                '    <option name="ADDED_LINES_COLOR" value="5f7210" />' +
51
                '    <option name="ANNOTATIONS_COLOR" value="8b999f" />' +
52
                '    <option name="CARET_COLOR" value="60999d" />' +
53
                '    <option name="CARET_ROW_COLOR" value="c1418" />' +
54
                '    <option name="CONSOLE_BACKGROUND_KEY" value="" />' +
55
                '  </colors>' +
56
                '</scheme>';
57
58
            const parsed = parser.parse(iclsSample);
59
60
            expect(parsed).to.have.property('colors');
61
62
            const colors = parsed.colors;
63
64
            expect(colors).to.have.property('added_lines_color', "5f7210");
65
            expect(colors).to.have.property('annotations_color', "8b999f");
66
            expect(colors).to.have.property('caret_color', "60999d");
67
            expect(colors).to.have.property('caret_row_color', "c1418");
68
            expect(colors).to.have.property('console_background_key', "");
69
        });
70
71
    });
72
});
73