You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 28, 2019. It is now read-only.
const uri = `${process.env.DATABASE_PROTOCOL}://${process.env.DATABASE_USER}:${process.env.DATABASE_PASSWORD}@${process.env.DATABASE_ADDRESS}/${process.env.DATABASE_NAME}`
// require module
let m = null
beforeAll(() => {
jest.mock('mongoose', () => {
return {
Schema: function (o) { return o },
model: function (n, s) { return n },
}
})
m = require('./user')
return m
})
test('requires module and sets it up', () => {
expect(m).toBeTruthy()
})
test('creates a correct uri', done => {
m((u, n) => new Promise((resolve, reject) => {
expect(u).toBe(uri)
done()
const connection = {
model: function (collectionName) { }
}
resolve(connection)
}))
})
test('connects to the correct collection', done => {