You will need:
After those have been installed, clone this repo:
cd sustainability-game
npm install
meteor
You may have to run sudo npm install
to get the NPM modules installed.
Once you know meteor can run and launch without errors, you can run tests using:
npm test
Writing and running tests is an important part of any project.
Test files are "linked" to their source file. Say you are working on client/components/home/title.jsx
and you want to write tests for it. Create a file: client/components/home/tests/title.jsx
.
That file would look something like this:
const { describe, it } = global;
import {expect} from 'chai';
import {shallow} from 'enzyme';
import Title from '../title.jsx';
describe('Home title', () => {
it('should display the title', () => {
const title = {title: 'Sustainability Game'};
const el = shallow(<Title title={title} />);
expect(el.find('h2').text()).to.be.match(/Sustainability Game/);
});
});
For more information on writing tests, read:
- MochaJS - this is our test runner
- ChaiJS - this is our assertion library
- AirBnB:Enzyme Documentation - this is the React testing library we use
- Mantra Testing - this is the methodlogy we follow
See our code review guidelines.
Please see the Wiki for documentation on the development process, links to developer resources, and meeting notes.