-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from sombriks/develop
testing release
- Loading branch information
Showing
63 changed files
with
2,843 additions
and
2,213 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import {dbMigrate, knex} from "./db/index.mjs"; | ||
import { dbMigrate, knex } from "./db/index.mjs"; | ||
|
||
/** | ||
* hooks to make sure there will be a testing database available and proper | ||
* teardown after all tests are done https://mochajs.org/#root-hook-plugins | ||
*/ | ||
export const mochaHooks = { | ||
async beforeAll() { await dbMigrate() }, | ||
async afterAll() { await knex.destroy() } | ||
} | ||
async beforeAll() { | ||
await dbMigrate(); | ||
}, | ||
async afterAll() { | ||
await knex.destroy(); | ||
}, | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import Cabin from 'cabin' | ||
import Signale from 'signale/signale.js' | ||
import Cabin from "cabin"; | ||
import Signale from "signale/signale.js"; | ||
|
||
export const logger = new Signale({ | ||
config: { | ||
// displayFilename: true, | ||
displayTimestamp: true, | ||
displayDate: true, | ||
} | ||
config: { | ||
// displayFilename: true, | ||
displayTimestamp: true, | ||
displayDate: true, | ||
}, | ||
}); | ||
export const cabin = new Cabin({ logger }) | ||
export const cabin = new Cabin({ logger }); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import Knex from "knex" | ||
import cfg from "./knexfile.cjs" | ||
import Knex from "knex"; | ||
import cfg from "./knexfile.cjs"; | ||
|
||
const nodeEnv = process.env.NODE_ENV || "development" | ||
const nodeEnv = process.env.NODE_ENV || "development"; | ||
|
||
export const dbMigrate = () => knex.migrate.latest(cfg[nodeEnv]); | ||
|
||
export const knex = Knex(cfg[nodeEnv]) | ||
export const knex = Knex(cfg[nodeEnv]); |
This file contains 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
Oops, something went wrong.