Skip to content

Commit 98b1169

Browse files
rtsaofkling
authored andcommitted
Fix findExportedComponentDefinition unit tests (#77)
* Fix test * Test on node 4 and 5
1 parent 811477a commit 98b1169

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ sudo: false
22
language: node_js
33
node_js:
44
- 4
5-
- stable
5+
- 5

src/resolver/__tests__/findExportedComponentDefinition-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ describe('findExportedComponentDefinition', () => {
483483
});
484484
});
485485

486-
describe.only('stateless components', () => {
486+
describe('stateless components', () => {
487487

488488
it('finds named exports', () => {
489489
var source = `
@@ -675,12 +675,12 @@ describe('findExportedComponentDefinition', () => {
675675
var source = `
676676
import React from 'React';
677677
var foo = 42;
678-
function Component = () { return <div />; }
678+
function Component() { return <div />; }
679679
export {foo, Component};
680680
`;
681681
var result = parse(source);
682682
expect(result).toBeDefined();
683-
expect(result.node.type).toBe('ClassExpression');
683+
expect(result.node.type).toBe('FunctionDeclaration');
684684

685685
source = `
686686
import React from 'React';
@@ -690,7 +690,7 @@ describe('findExportedComponentDefinition', () => {
690690
`;
691691
result = parse(source);
692692
expect(result).toBeDefined();
693-
expect(result.node.type).toBe('ClassExpression');
693+
expect(result.node.type).toBe('ArrowFunctionExpression');
694694

695695
source = `
696696
import React from 'React';
@@ -701,7 +701,7 @@ describe('findExportedComponentDefinition', () => {
701701
`;
702702
result = parse(source);
703703
expect(result).toBeDefined();
704-
expect(result.node.type).toBe('ClassExpression');
704+
expect(result.node.type).toBe('FunctionExpression');
705705
});
706706

707707
it('errors if multiple components are exported', () => {

0 commit comments

Comments
 (0)