Created
April 15, 2018 15:03
-
-
Save bennycode/6bcc88b09aefb42583339164cbb6a828 to your computer and use it in GitHub Desktop.
Testing Objection.js Model with Knex & Jasmine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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