Welcome to mirror list, hosted at ThFree Co, Russian Federation.

arguments.js « test « fs-vacuum « node_modules « npm « deps - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d77ce0627d29fa50b61acce9c270bfc0972145b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()
})