-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* glob data files in data folder, excluding listitems * merge data as global data
- Loading branch information
Showing
6 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ "data" : "test" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "foo" : "bar" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"test_list_item" : "izzn thizzle" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
'use strict'; | ||
|
||
exports['test nodeunit'] = { | ||
'hello world' : function(test){ | ||
test.equals(1,1); | ||
test.done(); | ||
} | ||
}; | ||
'buildPatternData - should merge all JSON files in the data folder except listitems' : function(test){ | ||
var fs = require('fs-extra'); | ||
var plMain = require('../core/lib/patternlab'); | ||
var data_dir = './test/files/_data/'; | ||
|
||
var dataResult = plMain.build_pattern_data(data_dir, fs); | ||
test.equals(dataResult.data, "test"); | ||
test.equals(dataResult.foo, "bar"); | ||
test.equals(dataResult.test_list_item, undefined); | ||
test.done(); | ||
} | ||
}; |