Skip to content

Commit 4e88ba3

Browse files
author
gevorg94
committed
test(Utils): Test for Utils
added missing tests for Utils getActualPath function
1 parent 648649e commit 4e88ba3

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

lib/utils/test/utils.test.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
/* global expect */
2-
import { testUtil } from '../utils';
2+
import { getActualSource } from '../utils';
33

4-
test('[Utils]: Should be defined', () => {
5-
expect(testUtil).toBeDefined();
4+
describe('[Utils]', () => {
5+
describe('[getActualSource]', () => {
6+
it('should be defined', () => {
7+
expect(getActualSource).toBeInstanceOf(Function);
8+
});
9+
it('using assets path, should return string', () => {
10+
const PATH_TO_SORUCE = 'pathToSource';
11+
const returnValue = getActualSource(PATH_TO_SORUCE);
12+
13+
expect(returnValue).toBe(PATH_TO_SORUCE);
14+
});
15+
it('using require(), should return string', () => {
16+
const returnValue = getActualSource(require('../../../test.jpeg'));
17+
expect(returnValue).toMatch(/http:\/\//);
18+
});
19+
});
620
});

test.jpeg

1.11 KB
Loading

0 commit comments

Comments
 (0)