searchneu
searchneu copied to clipboard
More comprehensive test suites
Currently some of our code remains untested, e.g. addprereqsfor and home.js.
Lets fix that.
Also we should definitely have more descriptive test suites, e.g. in backend/scrapers/employees/tests/coe.test.js:
it('should parse q', async (done) => {
const body = await fs.readFile(path.join(__dirname, 'data', 'coe', 'letter q.html'));
const retVal = coe.scrapeLetter(body);
expect(retVal.length).toEqual(0);
done();
});
it('should parse q', async (done) => {
const body = await fs.readFile(path.join(__dirname, 'data', 'coe', 'detail page.html'));
const retVal = coe.scrapeDetailpage(body);
expect(retVal).toMatchSnapshot();
done();
});
Just added the first two unit tests in the frontend. We can probably do the rest in a similar way
Just added tests for most of the files in the frontend and changed the name of the second test in your comment! We could add more detailed tests for a bunch of the files in the frontend if we want to add them. https://github.com/ryanhugh/searchneu/pull/41
Lets aim for 90%+ coverage!
😱😱😱😱😱