Open luketheobscure opened 5 years ago
At the least we should document this.
Can I see the full resolver setup? I've never used engines so I'm not familiar.
Here's the entirety of our setup-rendering-test
file:
import { setupRenderingTest } from 'ember-qunit';
import engineResolverFor from 'ember-engines/test-support/engine-resolver-for';
import Resolver from 'dummy/resolver';
export default function (hooks: NestedHooks): void {
const engineResolver = engineResolverFor('crop-records-engine');
const resolver = Resolver.extend({
namespace: { modulePrefix: 'dummy' },
resolve() {
const resolved = this._super(...arguments);
if (resolved) {
return resolved;
}
return engineResolver.resolve(...arguments);
},
}).create();
return setupRenderingTest(hooks, { resolver });
}
Bug or question
When using a custom resolver (like what's recommended in the engines testing guide), ember-cli-mirage doesn't find the dummy config. The code where mirage registers the config does run, but it looks like it registers it with the wrong resolver.
I've got this working by manually registering the config before calling setupMirage: