2015-12-01 14:31:15 -06:00
|
|
|
export default function(helpers) {
|
|
|
|
const { response } = helpers;
|
|
|
|
const fixturesByUrl = {};
|
|
|
|
|
|
|
|
// Load any fixtures automatically
|
2016-04-28 15:37:20 -05:00
|
|
|
Object.keys(require._eak_seen).forEach(entry => {
|
2015-12-01 14:31:15 -06:00
|
|
|
if (/^fixtures/.test(entry)) {
|
|
|
|
const fixture = require(entry, null, null, true);
|
|
|
|
if (fixture && fixture.default) {
|
|
|
|
const obj = fixture.default;
|
2016-04-28 15:37:20 -05:00
|
|
|
Object.keys(obj).forEach(url => {
|
2015-12-01 14:31:15 -06:00
|
|
|
fixturesByUrl[url] = obj[url];
|
|
|
|
this.get(url, () => response(obj[url]));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return fixturesByUrl;
|
2018-06-15 10:03:24 -05:00
|
|
|
}
|