From 2f96160115ed471a1f5464f01ef98c59e3772402 Mon Sep 17 00:00:00 2001 From: Jake Marsh Date: Wed, 11 May 2016 21:01:40 -0700 Subject: [PATCH 1/5] relocate and update tests --- README.md | 6 +- __tests__/components/Footer.test.js | 18 ---- __tests__/components/Header.test.js | 18 ---- __tests__/pages/HomePage.test.js | 31 ------ __tests__/pages/NotFoundPage.test.js | 31 ------ __tests__/pages/SearchPage.test.js | 52 ---------- __tests__/stores/CurrentUserStore.test.js | 47 --------- gulp/config.js | 4 +- gulp/tasks/test.js | 15 ++- package.json | 3 +- {__tests__ => tests}/.eslintrc | 0 {__tests__ => tests}/App.test.js | 0 tests/components/Footer.test.js | 28 ++++++ tests/components/Header.test.js | 28 ++++++ {__tests__ => tests}/helper.js | 0 tests/pages/HomePage.test.js | 27 +++++ tests/pages/NotFoundPage.test.js | 27 +++++ tests/pages/SearchPage.test.js | 48 +++++++++ tests/stores/CurrentUserStore.test.js | 66 ++++++++++++ {__tests__ => tests}/utils/APIUtils.test.js | 0 {__tests__ => tests}/utils/AuthAPI.test.js | 0 utils/fixtures.js | 15 +++ utils/testHelpers.js | 105 +------------------- 23 files changed, 253 insertions(+), 316 deletions(-) delete mode 100644 __tests__/components/Footer.test.js delete mode 100644 __tests__/components/Header.test.js delete mode 100644 __tests__/pages/HomePage.test.js delete mode 100644 __tests__/pages/NotFoundPage.test.js delete mode 100644 __tests__/pages/SearchPage.test.js delete mode 100644 __tests__/stores/CurrentUserStore.test.js rename {__tests__ => tests}/.eslintrc (100%) rename {__tests__ => tests}/App.test.js (100%) create mode 100644 tests/components/Footer.test.js create mode 100644 tests/components/Header.test.js rename {__tests__ => tests}/helper.js (100%) create mode 100644 tests/pages/HomePage.test.js create mode 100644 tests/pages/NotFoundPage.test.js create mode 100644 tests/pages/SearchPage.test.js create mode 100644 tests/stores/CurrentUserStore.test.js rename {__tests__ => tests}/utils/APIUtils.test.js (100%) rename {__tests__ => tests}/utils/AuthAPI.test.js (100%) create mode 100644 utils/fixtures.js diff --git a/README.md b/README.md index 4403de4..3a1ab03 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,13 @@ Along with many Gulp libraries (these can be seen in either `package.json`, or a 1. If you haven't already, follow steps 1 & 2 above 2. If you haven't already run `gulp dev` or `gulp prod` at least once, run `gulp prod` -3. Run all tests in the `__tests__/` directory with the `gulp test` command +3. Run all tests in the `tests/` directory with the `gulp test` command * A single file can be run by specifing an `-f` flag: `gulp test -f ` - * In the `PATH_TO_TEST_FILE`, it is possible to omit the `__tests__/` prefix, as well as the `.test.js` suffix. They will be automatically added if not detected. + * In the `PATH_TO_TEST_FILE`, it is possible to omit the `tests/` prefix, as well as the `.test.js` suffix. They will be automatically added if not detected. ##### Code coverage -When running tests, code coverage will be automatically calculated and output to an HTML file using the [Istanbul](https://github.com/gotwarlost/istanbul) library. These files can be seen in the generated `__coverage__/` directory. +When running tests, code coverage will be automatically calculated and output to an HTML file using the [Istanbul](https://github.com/gotwarlost/istanbul) library. These files can be seen in the generated `coverage/` directory. --- diff --git a/__tests__/components/Footer.test.js b/__tests__/components/Footer.test.js deleted file mode 100644 index a055baf..0000000 --- a/__tests__/components/Footer.test.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -import React from 'react'; -import TestUtils from 'react-addons-test-utils'; - -import Footer from '../../app/js/components/Footer'; - -describe('Component: Footer', function() { - - it('should render properly', function() { - const footer = TestUtils.renderIntoDocument( -