1 var test = require('tap').test
3 var vacuum = require('../vacuum.js')
5 test('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')
12 test('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")