Skip to content

Commit

Permalink
Test confirms #337 is fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Mar 8, 2019
1 parent 0812197 commit f7de5b4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/TemplateDataTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,23 @@ test("TemplateData.cleanupData", t => {
tags: ["test1", "test2"]
});
});

test("Parent directory for data", async t => {
let dataObj = new TemplateData("./test/stubs-337/src/");
dataObj._setConfig({
dataTemplateEngine: false,
dir: {
input: "./test/stubs-337/src/",
data: "../data/"
}
});
dataObj.setInputDir("./test/stubs-337/src/");

let data = await dataObj.getData();

t.deepEqual(data, {
xyz: {
hi: "bye"
}
});
});
3 changes: 3 additions & 0 deletions test/stubs-337/data/xyz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"hi": "bye"
}

0 comments on commit f7de5b4

Please sign in to comment.