Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const config = require('config');
- const knexConfig = config.get('knexConfig');
- module.exports = {
- development: {
- client: knexConfig.client,
- connection: {
- host: knexConfig.host,
- database: knexConfig.database,
- user: knexConfig.user,
- password: knexConfig.password,
- },
- pool: {
- min: knexConfig.min,
- max: knexConfig.max,
- },
- },
- test: {
- client: 'sqlite3',
- connection: {
- filename: './file.db',
- },
- },
- };
- process.env.NODE_ENV = 'test';
- const provider = require('../../../server/models/provider');
- describe('Should test provider Model', () => {
- test('should return provider', () => {
- provider
- .query()
- .then((providers) => {
- expect(providers).toBe('array');
- });
- });
- });
- Unhandled rejection Error: no database connection available for a query. You need to bind the model class or the query to a knex instance.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement