diff --git a/test/others.js b/test/others.js index 2411b00..163f56f 100644 --- a/test/others.js +++ b/test/others.js @@ -228,7 +228,7 @@ IGNORE_TEST_CASES.forEach(([d, patterns, path, [ignored, unignored]]) => { }) }) -_test('options.allowRelativePaths', t => { +_test('options.allowRelativePaths = true', t => { const ig = ignore({ allowRelativePaths: true }) @@ -241,3 +241,14 @@ _test('options.allowRelativePaths', t => { t.end() }) + +_test('options.allowRelativePaths = false (default value)', t => { + const ig = ignore() + + ig.add('foo') + + t.throws(() => ig.ignores('../foo/bar.js'), 'path.relative') + t.throws(() => ig.ignores('/foo/bar.js'), 'path.relative') + + t.end() +})