From 690621e2d11ebac1e073cb074dc3788b0b5beca9 Mon Sep 17 00:00:00 2001 From: Neamar Date: Thu, 13 Jul 2017 10:30:00 +0100 Subject: [PATCH] Updated test suite --- test/index.js | 36 ++++++++++++++++++++---------------- test/test-tree/Class.js | 1 + 2 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 test/test-tree/Class.js diff --git a/test/index.js b/test/index.js index 8949b91..9a649a8 100644 --- a/test/index.js +++ b/test/index.js @@ -12,6 +12,7 @@ describe("Autoload", function() { tree.should.eql({ '1': 1, '2': 2, + 'Class': "Class", 'withDash': "with-dash", '3': { '31': 31, @@ -24,12 +25,13 @@ describe("Autoload", function() { }); }); - it("should load all subdirectories based on root", function(){ + it("should load all subdirectories based on root", function() { var tree = autoload("test/test-tree"); tree.should.eql({ '1': 1, '2': 2, + 'Class': "Class", 'withDash': "with-dash", '3': { '31': 31, @@ -42,22 +44,23 @@ describe("Autoload", function() { }); }); - it("accepts the option 'deep' as false", function(){ - var tree = autoload("test/test-tree", { deep: false }); + it("should accept the option 'deep' as false", function() { + var tree = autoload("test/test-tree", {deep: false}); tree.should.eql({ '1': 1, '2': 2, + 'Class': "Class", 'withDash': "with-dash" }); }); - - it("accepts the option 'deep' as true (same as default)", function(){ - autoload("test/test-tree", { deep: true }).should.eql(autoload("test/test-tree")); + + it("accepts the option 'deep' as true (same as default)", function() { + autoload("test/test-tree", {deep: true}).should.eql(autoload("test/test-tree")); }); - it("accepts the option 'js' as false", function(){ - var tree = autoload("test/test-tree", { js: false }); + it("accepts the option 'js' as false", function() { + var tree = autoload("test/test-tree", {js: false}); tree.should.eql({ '3': { @@ -69,17 +72,18 @@ describe("Autoload", function() { } }); }); - - it("accepts the option 'js' as true (same as default)", function(){ - autoload("test/test-tree", { js: true }).should.eql(autoload("test/test-tree")); + + it("accepts the option 'js' as true (same as default)", function() { + autoload("test/test-tree", {js: true}).should.eql(autoload("test/test-tree")); }); - it("accepts the option 'json' as false", function(){ - var tree = autoload("test/test-tree", { json: false }); + it("accepts the option 'json' as false", function() { + var tree = autoload("test/test-tree", {json: false}); tree.should.eql({ '1': 1, '2': 2, + 'Class': "Class", 'withDash': "with-dash", '3': { '31': 31, @@ -87,8 +91,8 @@ describe("Autoload", function() { } }); }); - - it("accepts the option 'json' as true (same as default)", function(){ - autoload("test/test-tree", { json: true }).should.eql(autoload("test/test-tree")); + + it("accepts the option 'json' as true (same as default)", function() { + autoload("test/test-tree", {json: true}).should.eql(autoload("test/test-tree")); }); }); diff --git a/test/test-tree/Class.js b/test/test-tree/Class.js new file mode 100644 index 0000000..362a018 --- /dev/null +++ b/test/test-tree/Class.js @@ -0,0 +1 @@ +module.exports = "Class";