Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 26 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import fs from 'fs'; |
||
2 | import path from 'path'; |
||
3 | import { isStream } from 'tests/entry'; |
||
4 | import { FunctionTester, testsRootFolder } from '../../Test'; |
||
5 | |||
6 | const directory = path.join(testsRootFolder, 'mock/files/'); |
||
7 | const tester = new FunctionTester(isStream); |
||
8 | |||
9 | suite('CheckTypes: isStream'); |
||
10 | |||
11 | test('Positive: isStream with node fs streams input @example', function () { |
||
12 | tester.test(fs.createReadStream(path.join(directory, 'input.txt')), true); |
||
13 | tester.test(fs.createWriteStream(path.join(directory, 'out.txt')), true); |
||
14 | }); |
||
15 | |||
16 | test('Negative: isStream with no-streams input @example', function () { |
||
17 | tester.test(14, false); |
||
18 | tester.test('sdsdsd', false); |
||
19 | tester.test(() => {}, false); |
||
20 | tester.test(class A {}, false); |
||
21 | tester.test(undefined, false); |
||
22 | }); |
||
23 | |||
24 | after(async function () { |
||
25 | // console.log('after', this); |
||
26 | }); |
||
27 | |||
28 |