Skip to content

Commit

Permalink
Changed test for codeclimat
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanLiVa committed Jul 2, 2024
1 parent 4cd95a8 commit 53bedfd
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 26 deletions.
22 changes: 8 additions & 14 deletions __tests__/_formaters_.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,22 @@ import stylish from '../src/formatters/stylish.js';
import formatPlain from '../src/formatters/plain.js';
import genDiff from '../src/index.js';

const diffWithUnknownType = [
{
key: 'someKey',
type: 'unknownType',
value: 'someValue',
},
];

describe('should throw an error for unknown type', () => {
test('stylish for unknown type', () => {
const diffWithUnknownType = [
{
key: 'someKey',
type: 'unknownType',
value: 'someValue',
},
];
expect(() => {
stylish(diffWithUnknownType);
}).toThrow('Unknown type: unknownType');
});

test('plain for unknown type', () => {
const diffWithUnknownType = [
{
key: 'someKey',
type: 'unknownType',
value: 'someValue',
},
];
expect(() => {
formatPlain(diffWithUnknownType);
}).toThrow('Unknown type: unknownType');
Expand Down
4 changes: 2 additions & 2 deletions coverage/clover.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1719920183066" clover="3.2.0">
<project timestamp="1719920183066" name="All files">
<coverage generated="1719920944217" clover="3.2.0">
<project timestamp="1719920944217" name="All files">
<metrics statements="206" coveredstatements="206" conditionals="53" coveredconditionals="53" methods="14" coveredmethods="14" elements="273" coveredelements="273" complexity="0" loc="206" ncloc="206" packages="2" files="7" classes="7"/>
<package name="src">
<metrics statements="88" coveredstatements="88" conditionals="19" coveredconditionals="19" methods="7" coveredmethods="7"/>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h1>All files</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/buildTree.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> buildTr
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/formatters/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ <h1><a href="../../index.html">All files</a> src/formatters</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/formatters/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/formatte
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/formatters/json.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/formatte
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/formatters/plain.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/formatte
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/formatters/stylish.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ <h1><a href="../../index.html">All files</a> / <a href="index.html">src/formatte
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="../../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h1><a href="../index.html">All files</a> src</h1>
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> index.j
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/src/parser.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ <h1><a href="../index.html">All files</a> / <a href="index.html">src</a> parser.
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2024-07-02T11:36:23.054Z
at 2024-07-02T11:49:04.205Z
</div>
<script src="../prettify.js"></script>
<script>
Expand Down

0 comments on commit 53bedfd

Please sign in to comment.