node/deps/npm/node_modules/fs-vacuum/test/arguments.js
Rebecca Turner 5c36cfc843 deps: upgrade npm to 3.8.9
Contains the following three npm releases:
https://github.com/npm/npm/releases/tag/v3.8.7
https://github.com/npm/npm/releases/tag/v3.8.8
https://github.com/npm/npm/releases/tag/v3.8.9

PR-URL: https://github.com/nodejs/node/pull/6664
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-05-10 14:45:28 -04:00

25 lines
718 B
JavaScript

var test = require('tap').test
var vacuum = require('../vacuum.js')
test('vacuum throws on missing parameters', function (t) {
t.throws(vacuum, 'called with no parameters')
t.throws(function () { vacuum('directory', {}) }, 'called with no callback')
t.end()
})
test('vacuum throws on incorrect types ("Forrest is pedantic" section)', function (t) {
t.throws(function () {
vacuum({}, {}, function () {})
}, 'called with path parameter of incorrect type')
t.throws(function () {
vacuum('directory', 'directory', function () {})
}, 'called with options of wrong type')
t.throws(function () {
vacuum('directory', {}, 'whoops')
}, "called with callback that isn't callable")
t.end()
})