diff --git a/test/plugin.spec.js b/test/plugin.spec.js index 71ecf17..1ba2aa1 100644 --- a/test/plugin.spec.js +++ b/test/plugin.spec.js @@ -16,7 +16,7 @@ describe('Babel Root Import', () => { describe('transformRelativeToRootPath', () => { it('returns a string', () => { - const func = plugin.transformRelativeToRootPath(); + const func = plugin.transformRelativeToRootPath(''); expect(func).to.be.a('string'); }); @@ -25,6 +25,12 @@ describe('Babel Root Import', () => { const result = plugin.transformRelativeToRootPath('~/some/path'); expect(result).to.equal(rootPath); }); + + it('throws error if no string is passed', () => { + expect(() => { + plugin.transformRelativeToRootPath(); + }).to.throw(Error); + }); }); describe('hasTildeInString', () => {