Skip to content

Commit

Permalink
test error updates
Browse files Browse the repository at this point in the history
  • Loading branch information
johndatserakis committed Sep 3, 2017
1 parent 9748255 commit d3cbeb9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/db/migrations/20170826111515_create_users_table.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//I only want migrations, rollbacks, and seeds to run when the NODE_ENV is specified
//in the knex seed/migrate command. Knex will error out if it is not specified.
if (!process.env.NODE_ENV) { return; }
if (!process.env.NODE_ENV) { throw new Error('NODE_ENV not set') }

exports.up = function(knex, Promise) {
return knex.schema.createTable('users', function(table) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//I only want migrations, rollbacks, and seeds to run when the NODE_ENV is specified
//in the knex seed/migrate command. Knex will error out if it is not specified.
if (!process.env.NODE_ENV) { return; }
if (!process.env.NODE_ENV) { throw new Error('NODE_ENV not set') }

exports.up = function(knex, Promise) {
return knex.schema.createTable('refresh_tokens', function(table) {
Expand Down
2 changes: 1 addition & 1 deletion src/db/migrations/20170826132806_create_notes_table.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//I only want migrations, rollbacks, and seeds to run when the NODE_ENV is specified
//in the knex seed/migrate command. Knex will error out if it is not specified.
if (!process.env.NODE_ENV) { return; }
if (!process.env.NODE_ENV) { throw new Error('NODE_ENV not set') }

exports.up = function(knex, Promise) {
return knex.schema.createTable('notes', function(table) {
Expand Down
2 changes: 1 addition & 1 deletion src/db/seeds/dev/seed_notes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//I only want migrations, rollbacks, and seeds to run when the NODE_ENV is specified
//in the knex seed/migrate command. Knex will error out if it is not specified.
if (!process.env.NODE_ENV) { return; }
if (!process.env.NODE_ENV) { throw new Error('NODE_ENV not set') }

const faker = require('faker')

Expand Down
2 changes: 1 addition & 1 deletion src/db/seeds/dev/seed_users.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//I only want migrations, rollbacks, and seeds to run when the NODE_ENV is specified
//in the knex seed/migrate command. Knex will error out if it is not specified.
if (!process.env.NODE_ENV) { return; }
if (!process.env.NODE_ENV) { throw new Error('NODE_ENV not set') }

const faker = require('faker')
const bcrypt = require('bcrypt')
Expand Down
3 changes: 3 additions & 0 deletions tests/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//Only run tests if we've specifically set NODE_ENV to testing
if (process.env.NODE_ENV !== 'testing') { throw new Error('NODE_ENV not set') }

//This starts the app up
import { server } from '../app'

Expand Down

0 comments on commit d3cbeb9

Please sign in to comment.