Skip to content

Commit

Permalink
test: fix code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowgate15 committed Nov 11, 2021
1 parent 7449d0e commit ffff1d9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,15 @@ test('throws if acceptedExtensions is false', (t) => {
{ message: '`acceptedExtensions` must be defined and an Array' }
);
});

test('throws if root is not a directory', (t) => {
t.throws(
() =>
new Bree({
jobs: ['basic'],
...baseConfig,
root: path.resolve(__dirname, 'add.js')
}),
{ message: /Root directory of .+ does not exist/ }
);
});
15 changes: 15 additions & 0 deletions test/job-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,3 +514,18 @@ test('throws if job.timezone is invalid or unsupported', (t) => {
}
);
});

test('throws if path is not a file during object job', (t) => {
t.throws(
() => jobValidator({ name: 'leroy.js' }, 0, ['exists'], baseConfig),
{
message: /path missing/
}
);
});

test('throws if path is not a file during string job', (t) => {
t.throws(() => jobValidator('leroy.js', 0, ['exists'], baseConfig), {
message: /path missing/
});
});

0 comments on commit ffff1d9

Please sign in to comment.