Changed to use different fixtures during testing

- this keeps production and test fixtures separate, so that changing the prod fixtures doesn't change the shape of our tests.
- we may still want to test that the production fixtures do what we expect, but that can be handled in a separate integration test, by specifically setting the fixture path
This commit is contained in:
Hannah Wolfe 2021-11-16 13:03:20 +00:00
parent 5ccc1914f5
commit b781e47cb9
No known key found for this signature in database
GPG Key ID: 9F8C7532D0A6BA55
4 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,8 @@
const FixtureManager = require('./fixture-manager');
const fixtures = require('./fixtures');
const config = require('../../../../shared/config');
const fixturePath = config.get('paths').fixtures;
const fixtures = require(fixturePath);
module.exports.FixtureManager = FixtureManager;
module.exports.fixtureManager = new FixtureManager(fixtures);

View File

@ -15,7 +15,8 @@
"privacy": false,
"useMinFiles": true,
"paths": {
"contentPath": "content/"
"contentPath": "content/",
"fixtures": "core/server/data/schema/fixtures/fixtures"
},
"adapters": {
"sso": {

View File

@ -49,5 +49,8 @@
"useTinfoil": true,
"useStructuredData": true
},
"useMinFiles": false
"useMinFiles": false,
"paths": {
"fixtures": "test/utils/fixtures/fixtures"
}
}

View File

@ -95,6 +95,7 @@ describe('Config Loader', function () {
// and it doesn't make sure to check for "extra" keys
Object.keys(pathConfig).should.eql([
'contentPath',
'fixtures',
'appRoot',
'corePath',
'clientAssets',