From 07bfcf8b0eb48bbdb16a4a0532adf11a293af716 Mon Sep 17 00:00:00 2001 From: Stephan Herzog Date: Mon, 15 Aug 2016 10:50:07 +0200 Subject: [PATCH] Updated .eslintrc and Mocha tests #50 (#51) Closes #50 --- test/.eslintrc | 8 +++++++- test/components/AppTest.js | 13 ++++++------- test/components/YeomanImageTest.js | 5 ++--- test/config/ConfigTest.js | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/test/.eslintrc b/test/.eslintrc index edb03a7..b0fe1dd 100644 --- a/test/.eslintrc +++ b/test/.eslintrc @@ -1,8 +1,14 @@ { + "env": { + "mocha": true + }, "globals": { "expect": true }, "rules": { - "import/no-extraneous-dependencies": 0 + "import/no-extraneous-dependencies": 0, + "prefer-arrow-callback": 0, + "func-names": 0, + "strict": 0 } } diff --git a/test/components/AppTest.js b/test/components/AppTest.js index 596f7e7..649c300 100644 --- a/test/components/AppTest.js +++ b/test/components/AppTest.js @@ -2,17 +2,16 @@ import React from 'react'; import { shallow } from 'enzyme'; import App from 'components/App'; -describe('', () => { +describe('', function () { - let component; - beforeEach(() => { - component = shallow(); + beforeEach(function () { + this.component = shallow(); }); - describe('when rendering the component', () => { + describe('when rendering the component', function () { - it('should have a className of "index"', () => { - expect(component.hasClass('index')).to.equal(true); + it('should have a className of "index"', function () { + expect(this.component.hasClass('index')).to.equal(true); }); }); }); diff --git a/test/components/YeomanImageTest.js b/test/components/YeomanImageTest.js index e1af232..499ae3a 100644 --- a/test/components/YeomanImageTest.js +++ b/test/components/YeomanImageTest.js @@ -2,10 +2,9 @@ import React from 'react'; import { shallow } from 'enzyme'; import YeomanImage from 'components/YeomanImage'; -describe('', () => { - - it('should render an image tag', () => { +describe('', function () { + it('should render an image tag', function () { const component = shallow(); expect(component.find('img').length).to.equal(1); }); diff --git a/test/config/ConfigTest.js b/test/config/ConfigTest.js index 4c0f99d..0b9b4d4 100644 --- a/test/config/ConfigTest.js +++ b/test/config/ConfigTest.js @@ -1,8 +1,8 @@ import config from 'config'; -describe('Application Environment', () => { +describe('Application Environment', function () { - it('should load app config file depending on current --env', () => { + it('should load app config file depending on current --env', function () { expect(config.appEnv).to.equal('test'); }); });