mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
d50fb7c922
- We've been seeing weird errors with tables not existing when running tests locally - This appears to happen after an error causes the tests to abort - This change includes two fixes: 1. we triggers a full DB reset just before the entire test suite runs - this is done by wrapping the override file for tests that use a db, and supplying a mochaGlobalSetup hook 2. catch errors when attempting to do a fast truncation-based reset & init, and do a full reset & init instead - These two changes should ensure the DB is always in the state we expect when running a new test suite
13 lines
397 B
JavaScript
13 lines
397 B
JavaScript
process.env.NODE_ENV = process.env.NODE_ENV || 'testing';
|
|
|
|
/**
|
|
* This overrides file should be used for all tests that DO NOT use the DB - e.g. unit tests
|
|
*/
|
|
|
|
process.env.WEBHOOK_SECRET = process.env.WEBHOOK_SECRET || 'TEST_STRIPE_WEBHOOK_SECRET';
|
|
|
|
require('../../core/server/overrides');
|
|
|
|
const {mochaHooks} = require('@tryghost/express-test').snapshot;
|
|
module.exports.mochaHooks = mochaHooks;
|