Skip to content

Commit b050926

Browse files
author
michaelzoidl
committed
Update tests
1 parent 8c2a9da commit b050926

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/plugin.spec.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Babel Root Import', () => {
1616

1717
describe('transformRelativeToRootPath', () => {
1818
it('returns a string', () => {
19-
const func = plugin.transformRelativeToRootPath();
19+
const func = plugin.transformRelativeToRootPath('');
2020
expect(func).to.be.a('string');
2121
});
2222

@@ -25,6 +25,12 @@ describe('Babel Root Import', () => {
2525
const result = plugin.transformRelativeToRootPath('~/some/path');
2626
expect(result).to.equal(rootPath);
2727
});
28+
29+
it('throws error if no string is passed', () => {
30+
expect(() => {
31+
plugin.transformRelativeToRootPath();
32+
}).to.throw(Error);
33+
});
2834
});
2935

3036
describe('hasTildeInString', () => {

0 commit comments

Comments
 (0)