Skip to content

Commit

Permalink
Add test for JSX support.
Browse files Browse the repository at this point in the history
  • Loading branch information
pahen committed Jul 3, 2016
1 parent b16f946 commit eba42cc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/files/es6/jsx/basic.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import other from './other';

export default React.createClass({
render: function() {
return <div>
foo
{this.props.children}
</div>
}
});
1 change: 1 addition & 0 deletions test/files/es6/jsx/other.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'other';
13 changes: 13 additions & 0 deletions test/jsx.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var should = require('should'),
madge = require('../lib/madge');

describe('JSX Basics', function() {
it('can detect imports', function() {
madge([__dirname + '/files/es6/jsx/basic.jsx'], {
format: 'es6'
}).obj().should.eql({basic: [
'../../../../other',
'../../../../react'
]});
});
});

0 comments on commit eba42cc

Please sign in to comment.