5a150cc3b6
refs https://github.com/TryGhost/Toolbox/issues/158 - Allows for much smaller amount of code to configure a test to work with chai-jest-snapshots. They now work automatically for all regression tests and could be enabled for other suites by adding the "--require=./test/utils/snapshots.js" parameter in respective test:* package script - Regenerated snapshot for authentication test as the naming structure changed a little with the snapshot metadata being taken on a higher level in the test (uses the suite name instead of a specific describe it used to be called from)
15 lines
316 B
JavaScript
15 lines
316 B
JavaScript
const chai = require('chai');
|
|
const chaiJestSnapshot = require('@ethanresnick/chai-jest-snapshot');
|
|
|
|
chai.use(chaiJestSnapshot);
|
|
|
|
exports.mochaHooks = {
|
|
beforeAll() {
|
|
chaiJestSnapshot.resetSnapshotRegistry();
|
|
},
|
|
|
|
beforeEach() {
|
|
chaiJestSnapshot.configureUsingMochaContext(this);
|
|
}
|
|
};
|