Skip to content

Commit 864baca

Browse files
authored
Refactored V1 tests to use inline function #52 (#53)
1 parent e2ef6cf commit 864baca

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

test/components/MainTest.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ import createComponent from 'helpers/shallowRenderHelper';
1010

1111
import Main from 'components/Main';
1212

13-
describe('MainComponent', () => {
14-
let MainComponent;
13+
describe('MainComponent', function () {
1514

16-
beforeEach(() => {
17-
MainComponent = createComponent(Main);
15+
beforeEach(function () {
16+
this.MainComponent = createComponent(Main);
1817
});
1918

20-
it('should have its component name as default className', () => {
21-
expect(MainComponent.props.className).to.equal('index');
19+
it('should have its component name as default className', function () {
20+
expect(this.MainComponent.props.className).to.equal('index');
2221
});
2322
});

test/config/ConfigTest.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import config from 'config';
77

8-
describe('appEnvConfigTests', () => {
9-
it('should load app config file depending on current --env', () => {
8+
describe('appEnvConfigTests', function () {
9+
it('should load app config file depending on current --env', function () {
1010
expect(config.appEnv).to.equal('test');
1111
});
1212
});

0 commit comments

Comments
 (0)