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__/App.test.js b/__tests__/App.test.js deleted file mode 100644 index 6a7b185..0000000 --- a/__tests__/App.test.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -import React from 'react'; -import TestUtils from 'react-addons-test-utils'; - -import App from '../app/js/App'; -import CurrentUserStore from '../app/js/stores/CurrentUserStore'; -import CurrentUserActions from '../app/js/actions/CurrentUserActions'; -import {ListenerMixin} from 'reflux'; -import TestHelpers from '../utils/testHelpers'; - -describe('App', function() { - - it('#componentDidMount should listen to the user store and check login status', function() { - sandbox.mock(ListenerMixin).expects('listenTo').withArgs(CurrentUserStore, App._onUserChange).once(); - sandbox.mock(CurrentUserActions).expects('checkLoginStatus').once(); - - TestUtils.renderIntoDocument( - -
- - ); - }); - - it('#onUserChange should set the error state if an error is received', function() { - const err = { message: 'Test error message.' }; - const app = TestUtils.renderIntoDocument( - -
- - ); - - app.onUserChange(err, null); - app.state.error.should.eql(err); - }); - - it('#onUserChange should set the user state and clear error if a new user is received', function() { - const user = TestHelpers.fixtures.user; - const app = TestUtils.renderIntoDocument( - -
- - ); - - app.onUserChange(null, user); - app.state.currentUser.should.eql(user); - Should(app.state.error).be.null(); - }); - - it('#renderChildren should return all the cloned children', function() { - const app = TestUtils.renderIntoDocument( - -
- - ); - - TestUtils.findRenderedDOMComponentWithClass(app, 'test-child').should.not.throw(); - }); -}); \ No newline at end of file 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( -