1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | "use strict";
|
9 |
|
10 | var assert = require("assert");
|
11 | var jsDAV = require("./../lib/jsdav");
|
12 | var jsDAV_Filelist_Plugin = require("./../lib/DAV/plugins/filelist");
|
13 |
|
14 | jsDAV.debugMode = true;
|
15 |
|
16 | module.exports = {
|
17 | timeout: 30000,
|
18 |
|
19 | setUpSuite: function(next) {
|
20 | this.plugin = jsDAV_Filelist_Plugin.new({
|
21 | addEventListener : function(){}
|
22 | });
|
23 | next();
|
24 | },
|
25 |
|
26 | tearDownSuite: function(next) {
|
27 |
|
28 | next();
|
29 | },
|
30 |
|
31 | "test retrieving a file list": function(next) {
|
32 | this.plugin.doFilelist({path: "./"}, {}, function(err, out){
|
33 | assert.ok(out.toString().indexOf("test_filelist.js") > -1);
|
34 |
|
35 | next();
|
36 | }, function(err, code) { });
|
37 | },
|
38 |
|
39 | "test retrieving a file list including hidden files": function(next) {
|
40 | this.plugin.doFilelist({path: "../"}, {
|
41 | showHiddenFiles: "1",
|
42 | maxdepth: 1
|
43 | }, function(err, out){
|
44 | assert.ok(out.toString().indexOf("./.gitignore") > -1);
|
45 |
|
46 | next();
|
47 | }, function(err, code) { });
|
48 | }
|
49 | };
|
50 |
|
51 | process.on("exit", function() {
|
52 | if (module.exports.conn)
|
53 | module.exports.conn.end();
|
54 | });
|
55 |
|
56 | !module.parent && require("./../node_modules/asyncjs/lib/test").testcase(module.exports).exec();
|