Skip to content

Commit 8866478

Browse files
committed
add compare .yaml extension
1 parent 6062805 commit 8866478

File tree

18 files changed

+622
-128
lines changed

18 files changed

+622
-128
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ test:
2323
npm test
2424

2525
test-coverage:
26-
npm test -- --coverage --coverageProvider=v8
26+
npm test -- --coverage --coverageProvider=v8
27+
28+

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
### Hexlet tests and linter status:
2-
[![Actions Status](https://github.com/WisdomQuest/frontend-project-46/actions/workflows/hexlet-check.yml/badge.svg)](https://github.com/WisdomQuest/frontend-project-46/actions)
2+
[![github-actions](https://github.com/WisdomQuest/frontend-project-46/actions/workflows/github-actions.yml/badge.svg)](https://github.com/WisdomQuest/frontend-project-46/actions/workflows/github-actions.yml)
3+
4+
[![Test Coverage](https://api.codeclimate.com/v1/badges/b3483509ed87517cea27/test_coverage)](https://codeclimate.com/github/WisdomQuest/frontend-project-46/test_coverage)
35

46
Ascinema(lesson4)
57
[![asciicast](https://asciinema.org/a/wHepNLn0QNSfYXf9OyHoPT4HJ.svg)](https://asciinema.org/a/wHepNLn0QNSfYXf9OyHoPT4HJ)
68

7-
[![Test Coverage](https://api.codeclimate.com/v1/badges/b3483509ed87517cea27/test_coverage)](https://codeclimate.com/github/WisdomQuest/frontend-project-46/test_coverage)
9+
Ascinema(lesson6)
10+
[![asciicast](https://asciinema.org/a/HxkkOQiIYxm2vO2JyCDFUd5sn.svg)](https://asciinema.org/a/HxkkOQiIYxm2vO2JyCDFUd5sn)

__fixtures__/file1.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
host: hexlet.io
2+
timeout: 50
3+
proxy: 123.234.53.22
4+
follow: false

__fixtures__/file2.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
timeout: 20
2+
verbose: true
3+
host: hexlet.io

__test__/diffFiles.test.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,20 @@ const getFixturePath = (filename) =>
1414
const readFile = (filename) =>
1515
fs.readFileSync(getFixturePath(filename), 'utf-8');
1616

17-
const normalizedString = (str) => str.replace(/\r\n/g, '\n')
17+
const normalizedString = (str) => str.replace(/\r\n/g, '\n');
18+
19+
test('compareFilesJson', () => {
20+
const diffFiles = readFile('expectDiffFiles.txt');
21+
const file1 = parseFile(getFixturePath('file1.json'));
22+
const file2 = parseFile(getFixturePath('file2.json'));
23+
expect(compareFiles(file1, file2)).toEqual(normalizedString(diffFiles));
24+
});
25+
26+
test('compareFilesYaml', () => {
27+
const diffFiles = readFile('expectDiffFiles.txt');
28+
const file1 = parseFile(getFixturePath('file1.yaml'));
29+
const file2 = parseFile(getFixturePath('file2.yml'));
30+
expect(compareFiles(file1, file2)).toEqual(normalizedString(diffFiles));
31+
});
32+
1833

19-
test('compareFiles',()=>{
20-
const diffFiles = readFile('expectDiffFiles.txt')
21-
const file1 = parseFile(getFixturePath('file1.json'));
22-
const file2 = parseFile(getFixturePath('file2.json'));
23-
expect(compareFiles(file1,file2)).toEqual(normalizedString(diffFiles));
24-
})

coverage/clover.xml

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<coverage generated="1738658588246" clover="3.2.0">
3-
<project timestamp="1738658588247" name="All files">
4-
<metrics statements="57" coveredstatements="57" conditionals="8" coveredconditionals="8" methods="2" coveredmethods="2" elements="67" coveredelements="67" complexity="0" loc="57" ncloc="57" packages="1" files="2" classes="2"/>
2+
<coverage generated="1738668701741" clover="3.2.0">
3+
<project timestamp="1738668701741" name="All files">
4+
<metrics statements="70" coveredstatements="70" conditionals="11" coveredconditionals="11" methods="3" coveredmethods="3" elements="84" coveredelements="84" complexity="0" loc="70" ncloc="70" packages="1" files="2" classes="2"/>
55
<file name="diffFiles.js" path="/mnt/d/Учеба/Hexlet/Modul 3/Вычислитель отличий/frontend-project-46/src/diffFiles.js">
66
<metrics statements="46" coveredstatements="46" conditionals="7" coveredconditionals="7" methods="1" coveredmethods="1"/>
77
<line num="1" count="1" type="stmt"/>
88
<line num="2" count="1" type="stmt"/>
9-
<line num="3" count="1" type="cond" truecount="1" falsecount="0"/>
10-
<line num="4" count="1" type="stmt"/>
11-
<line num="5" count="1" type="stmt"/>
12-
<line num="6" count="1" type="stmt"/>
13-
<line num="7" count="1" type="cond" truecount="1" falsecount="0"/>
14-
<line num="8" count="5" type="cond" truecount="1" falsecount="0"/>
15-
<line num="9" count="2" type="stmt"/>
16-
<line num="10" count="2" type="cond" truecount="1" falsecount="0"/>
17-
<line num="11" count="5" type="cond" truecount="1" falsecount="0"/>
18-
<line num="12" count="1" type="stmt"/>
19-
<line num="13" count="1" type="cond" truecount="1" falsecount="0"/>
20-
<line num="14" count="5" type="cond" truecount="1" falsecount="0"/>
21-
<line num="15" count="1" type="stmt"/>
22-
<line num="16" count="1" type="stmt"/>
23-
<line num="17" count="1" type="stmt"/>
24-
<line num="18" count="1" type="stmt"/>
25-
<line num="19" count="1" type="stmt"/>
26-
<line num="20" count="1" type="stmt"/>
9+
<line num="3" count="2" type="cond" truecount="1" falsecount="0"/>
10+
<line num="4" count="2" type="stmt"/>
11+
<line num="5" count="2" type="stmt"/>
12+
<line num="6" count="2" type="stmt"/>
13+
<line num="7" count="2" type="cond" truecount="1" falsecount="0"/>
14+
<line num="8" count="10" type="cond" truecount="1" falsecount="0"/>
15+
<line num="9" count="4" type="stmt"/>
16+
<line num="10" count="4" type="cond" truecount="1" falsecount="0"/>
17+
<line num="11" count="10" type="cond" truecount="1" falsecount="0"/>
18+
<line num="12" count="2" type="stmt"/>
19+
<line num="13" count="2" type="cond" truecount="1" falsecount="0"/>
20+
<line num="14" count="10" type="cond" truecount="1" falsecount="0"/>
21+
<line num="15" count="2" type="stmt"/>
22+
<line num="16" count="2" type="stmt"/>
23+
<line num="17" count="2" type="stmt"/>
24+
<line num="18" count="2" type="stmt"/>
25+
<line num="19" count="2" type="stmt"/>
26+
<line num="20" count="2" type="stmt"/>
2727
<line num="21" count="1" type="stmt"/>
2828
<line num="22" count="1" type="stmt"/>
2929
<line num="23" count="1" type="stmt"/>
@@ -52,18 +52,31 @@
5252
<line num="46" count="1" type="stmt"/>
5353
</file>
5454
<file name="fileParser.js" path="/mnt/d/Учеба/Hexlet/Modul 3/Вычислитель отличий/frontend-project-46/src/fileParser.js">
55-
<metrics statements="11" coveredstatements="11" conditionals="1" coveredconditionals="1" methods="1" coveredmethods="1"/>
55+
<metrics statements="24" coveredstatements="24" conditionals="4" coveredconditionals="4" methods="2" coveredmethods="2"/>
5656
<line num="1" count="1" type="stmt"/>
5757
<line num="2" count="1" type="stmt"/>
5858
<line num="3" count="1" type="stmt"/>
5959
<line num="4" count="1" type="stmt"/>
60-
<line num="5" count="1" type="cond" truecount="1" falsecount="0"/>
61-
<line num="6" count="2" type="stmt"/>
62-
<line num="7" count="2" type="stmt"/>
63-
<line num="8" count="2" type="stmt"/>
60+
<line num="5" count="1" type="stmt"/>
61+
<line num="6" count="1" type="cond" truecount="1" falsecount="0"/>
62+
<line num="7" count="4" type="stmt"/>
63+
<line num="8" count="4" type="cond" truecount="2" falsecount="0"/>
6464
<line num="9" count="2" type="stmt"/>
65-
<line num="10" count="1" type="stmt"/>
66-
<line num="11" count="1" type="stmt"/>
65+
<line num="10" count="2" type="stmt"/>
66+
<line num="11" count="2" type="stmt"/>
67+
<line num="12" count="2" type="stmt"/>
68+
<line num="13" count="2" type="stmt"/>
69+
<line num="14" count="4" type="stmt"/>
70+
<line num="15" count="1" type="stmt"/>
71+
<line num="16" count="1" type="cond" truecount="1" falsecount="0"/>
72+
<line num="17" count="4" type="stmt"/>
73+
<line num="18" count="4" type="stmt"/>
74+
<line num="19" count="4" type="stmt"/>
75+
<line num="20" count="4" type="stmt"/>
76+
<line num="21" count="4" type="stmt"/>
77+
<line num="22" count="4" type="stmt"/>
78+
<line num="23" count="1" type="stmt"/>
79+
<line num="24" count="1" type="stmt"/>
6780
</file>
6881
</project>
6982
</coverage>

0 commit comments

Comments
 (0)