Open dangerdak opened 7 years ago
(me and Aisha discussed this)
Because .query is async, maybe each test should be inside the callback e.g.
dbConnection.query(sql, (err, res) => { if (err) return console.log(err); tape('SQL query case check', (t) => { getTopic('css', (err, res) => { const actual = res[0].topic; const expected = 'CSS'; t.equals(actual, expected, 'getTopic object output topic should be "CSS" as the SQL query string is case insensitive'); t.end(); }); }); });
https://github.com/FAC-11/theLibrary/blob/master/tests/database.test.js#L8
(me and Aisha discussed this)
Because .query is async, maybe each test should be inside the callback e.g.
https://github.com/FAC-11/theLibrary/blob/master/tests/database.test.js#L8