UNPKG

1.48 kBJavaScriptView Raw
1/*
2 * @package jsDAV
3 * @subpackage DAV
4 * @copyright Copyright(c) 2011 Ajax.org B.V. <info AT ajax.org>
5 * @author Ruben Daniels <ruben AT c9 DOT io>
6 * @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
7 */
8"use strict";
9
10var assert = require("assert");
11var jsDAV = require("./../lib/jsdav");
12var jsDAV_Filelist_Plugin = require("./../lib/DAV/plugins/filelist");
13
14jsDAV.debugMode = true;
15
16module.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
51process.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();