const methods = require('../routes/methods') describe("DB methohds test", () => { it('returns a user from DB by email', done => { methods.getUserByEmail('litehon958@whipjoy.com', function(resp, err){ try { expect(resp).not.toBeNull() expect(err).toBeNull() done() } catch (error) { done(error) } }) }) it("returns a user from DB by ID", done => { methods.getUserById(10, function(resp, err){ try { expect(resp).not.toBeNull() expect(err).toBeNull() done() } catch (error) { done(error) } }) }) it("checks user email", done => { methods.checkUserEmail("test@email.de", function(err, resp){ try { expect(resp).not.toBeNull() expect(err).toBeNull() done() } catch (error) { done(error) } }) }) it("returns a user by token", done => { methods.checkUserEmail("1abc0qwerty", function(err, resp){ // token = any alphanumeric try { expect(resp).not.toBeNull() expect(err).toBeNull() done() } catch (error) { done(error) } }) }) })