searchneu icon indicating copy to clipboard operation
searchneu copied to clipboard

More comprehensive test suites

Open edward-shen opened this issue 7 years ago • 4 comments

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();
});

edward-shen avatar Nov 17 '17 18:11 edward-shen

Just added the first two unit tests in the frontend. We can probably do the rest in a similar way

ryanhugh avatar Nov 17 '17 22:11 ryanhugh

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

ryanhugh avatar Nov 27 '17 22:11 ryanhugh

Lets aim for 90%+ coverage!

edward-shen avatar Dec 29 '17 04:12 edward-shen

😱😱😱😱😱

ryanhugh avatar Dec 29 '17 05:12 ryanhugh