Skip to content

Commit

Permalink
Updated test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Neamar committed Jul 13, 2017
1 parent bca237e commit 690621e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
36 changes: 20 additions & 16 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe("Autoload", function() {
tree.should.eql({
'1': 1,
'2': 2,
'Class': "Class",
'withDash': "with-dash",
'3': {
'31': 31,
Expand All @@ -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,
Expand All @@ -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': {
Expand All @@ -69,26 +72,27 @@ 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,
'32': {}
}
});
});
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"));
});
});
1 change: 1 addition & 0 deletions test/test-tree/Class.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "Class";

0 comments on commit 690621e

Please sign in to comment.