Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added .jsx to README #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This module can find, require and register any file type the npm ecosystem has a

**Currently supported extensions:**

`.co, .coffee, .csv, .iced, .ini, .js, .json, .litcoffee, .ls, .toml, .xml, .yaml, .yml`
`.co, .coffee, .csv, .iced, .ini, .js, .json, .jsx, .litcoffee, .ls, .toml, .xml, .yaml, .yml`

**Note:** If you'd like to add a new extension, please make a PR for [interpret](https://github.com/tkellen/node-interpret).

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@
"interpret": "^0.3.0"
},
"devDependencies": {
"mocha": "^1.17.1",
"LiveScript": "^1.2.0",
"chai": "^1.9.0",
"coco": "^0.9.1",
"coffee-script": "^1.7.1",
"require-csv": "0.0.1",
"iced-coffee-script": "^1.7.1-b",
"mocha": "^1.17.1",
"node-jsx": "^0.10.0",
"require-csv": "0.0.1",
"require-ini": "0.0.1",
"toml-require": "^1.0.1",
"require-xml": "0.0.1",
"require-yaml": "0.0.1",
"LiveScript": "^1.2.0"
"toml-require": "^1.0.1"
},
"keywords": [
"require",
Expand Down
13 changes: 13 additions & 0 deletions test/fixtures/test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @jsx React.DOM */

// Test harmony arrow functions
Component = () => {
var trueKey = true;
var falseKey = false;
var subKey = { subProp: 1 };
// Test harmony object short notation
return { data: { trueKey, falseKey, subKey}};
};

// Test JSX syntax
module.exports = <Component />;
6 changes: 5 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ describe('registerFor', function () {
rechoir.registerFor('./test/fixtures/test.json');
expect(require('./fixtures/test.json')).to.deep.equal(expected);
});
it('should know jsx', function () {
rechoir.registerFor('./test/fixtures/test.jsx');
expect(require('./fixtures/test.jsx')).to.deep.equal(expected);
});
it('should know livescript', function () {
rechoir.registerFor('./test/fixtures/test.ls');
expect(require('./fixtures/test.ls')).to.deep.equal(expected);
Expand All @@ -70,7 +74,7 @@ describe('registerFor', function () {

describe('load', function () {
it('should automatically register a loader and require', function () {
delete require.extensions['.coffee']
delete require.extensions['.coffee'];
expect(rechoir.load('./test/fixtures/test.json')).to.deep.equal(expected);
});
});