Skip to content

Instantly share code, notes, and snippets.

@bennycode
Created April 15, 2018 15:03
Show Gist options
  • Select an option

  • Save bennycode/6bcc88b09aefb42583339164cbb6a828 to your computer and use it in GitHub Desktop.

Select an option

Save bennycode/6bcc88b09aefb42583339164cbb6a828 to your computer and use it in GitHub Desktop.
Testing Objection.js Model with Knex & Jasmine
const config = require(`${process.cwd()}/knexfile`)[process.env.NODE_ENV];
const knex = require('knex')(config);
const {Model} = require('objection');
beforeAll(async done => {
await knex.migrate.latest();
await knex(Candlestick.tableName).truncate();
Model.knex(knex);
done();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment