• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1var test = require('tap').test
2
3var vacuum = require('../vacuum.js')
4
5test('vacuum throws on missing parameters', function (t) {
6  t.throws(vacuum, 'called with no parameters')
7  t.throws(function () { vacuum('directory', {}) }, 'called with no callback')
8
9  t.end()
10})
11
12test('vacuum throws on incorrect types ("Forrest is pedantic" section)', function (t) {
13  t.throws(function () {
14    vacuum({}, {}, function () {})
15  }, 'called with path parameter of incorrect type')
16  t.throws(function () {
17    vacuum('directory', 'directory', function () {})
18  }, 'called with options of wrong type')
19  t.throws(function () {
20    vacuum('directory', {}, 'whoops')
21  }, "called with callback that isn't callable")
22
23  t.end()
24})
25