getting started
- fork git repository
- git clone your fork
- install npm packages
npm install
- testing:
- create merge/pull request from your fork
- NB: make each task as a separate commit!
- Check examples.js for code usage examples
lint
: fix all linting errors (do not make new errors in future)unit
: use snapshot testing to testsrc/user.js
(use ids 1, 56 and 1345)unit
: use string as input(id) forsrc/user.js
- test that exception is givenunit
: write implementation (capitalize.js
) for this test (you can use npm packages incapitalize.js
)
// src/capitalize.spec.js
const capitalize = require('./capitalize');
describe('sum', () => {
it('triin => Triin', () => {
expect(capitalize('triin')).toBe("Triin");
});
it('error - bad input', () => {
expect(() => {
capitalize({ "word": 'cat' });
}).toThrow(/bad input/);
});
});
unit
: testsrc/randomPlus.js
while mockingsrc/random.js
(check from mock thatrandom
params was 1 and 99)