Skip to content

Commit 07bfcf8

Browse files
authored
Updated .eslintrc and Mocha tests #50 (#51)
Closes #50
1 parent bec5ab5 commit 07bfcf8

4 files changed

Lines changed: 17 additions & 13 deletions

File tree

test/.eslintrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
2+
"env": {
3+
"mocha": true
4+
},
25
"globals": {
36
"expect": true
47
},
58
"rules": {
6-
"import/no-extraneous-dependencies": 0
9+
"import/no-extraneous-dependencies": 0,
10+
"prefer-arrow-callback": 0,
11+
"func-names": 0,
12+
"strict": 0
713
}
814
}

test/components/AppTest.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ import React from 'react';
22
import { shallow } from 'enzyme';
33
import App from 'components/App';
44

5-
describe('<App />', () => {
5+
describe('<App />', function () {
66

7-
let component;
8-
beforeEach(() => {
9-
component = shallow(<App />);
7+
beforeEach(function () {
8+
this.component = shallow(<App />);
109
});
1110

12-
describe('when rendering the component', () => {
11+
describe('when rendering the component', function () {
1312

14-
it('should have a className of "index"', () => {
15-
expect(component.hasClass('index')).to.equal(true);
13+
it('should have a className of "index"', function () {
14+
expect(this.component.hasClass('index')).to.equal(true);
1615
});
1716
});
1817
});

test/components/YeomanImageTest.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import React from 'react';
22
import { shallow } from 'enzyme';
33
import YeomanImage from 'components/YeomanImage';
44

5-
describe('<YeomanImage />', () => {
6-
7-
it('should render an image tag', () => {
5+
describe('<YeomanImage />', function () {
86

7+
it('should render an image tag', function () {
98
const component = shallow(<YeomanImage />);
109
expect(component.find('img').length).to.equal(1);
1110
});

test/config/ConfigTest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import config from 'config';
22

3-
describe('Application Environment', () => {
3+
describe('Application Environment', function () {
44

5-
it('should load app config file depending on current --env', () => {
5+
it('should load app config file depending on current --env', function () {
66
expect(config.appEnv).to.equal('test');
77
});
88
});

0 commit comments

Comments
 (0)