Skip to content

Commit

Permalink
New: Add test for json5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Kellen authored and phated committed Jan 3, 2019
1 parent 427f9f7 commit 1eb24b7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"coco": "^0.9.1",
"coffee-script": "^1.7.1",
"iced-coffee-script": "^1.7.1-b",
"json5": "^0.4.0",
"mocha": "^1.17.1",
"node-jsx": "^0.10.0",
"require-csv": "0.0.1",
Expand Down
10 changes: 10 additions & 0 deletions test/fixtures/test.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"data": {
"trueKey": true,
"falseKey": false,
"subKey": {
"subProp": 1
}
}
/* omg, a comment in json?? */
}
5 changes: 4 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('registerFor', function () {
rechoir.registerFor('./test/fixtures/test.co');
expect(require('./fixtures/test.co')).to.deep.equal(expected);
});

it('should know coffee-script', function () {
rechoir.registerFor('./test/fixtures/test.coffee');
expect(require('./fixtures/test.coffee')).to.deep.equal(expected);
Expand Down Expand Up @@ -46,6 +45,10 @@ describe('registerFor', function () {
rechoir.registerFor('./test/fixtures/test.json');
expect(require('./fixtures/test.json')).to.deep.equal(expected);
});
it('should know .json5', function () {
rechoir.registerFor('./test/fixtures/test.json5');
expect(require('./fixtures/test.json5')).to.deep.equal(expected);
});
it('should know jsx', function () {
rechoir.registerFor('./test/fixtures/test.jsx');
expect(require('./fixtures/test.jsx')).to.deep.equal(expected);
Expand Down

0 comments on commit 1eb24b7

Please sign in to comment.