Closed RomkeVdMeulen closed 5 years ago
The section isn't very extensive, but the API is pretty straight-forward anyway. I tried to match the tone of the rest of the article.
The PR to aurelia-testing
already includes a test that pretty much matches the code sample I added here. But to be complete, something like this might be added to to doc-samples.spec.ts
as well:
describe('MyParentComponent', () => {
it('doesn\'t load the subcomponent', async () => {
const component = StageComponent
.withResources('test/resources/my-parent-component')
.inView('<my-parent-component></my-parent-component>')
.ignoreDependencies('test/resources/my-component');
await component.create(bootstrap);
expect(component.element.textContent!.trim()).toEqual('');
});
});
This is nice. I think we may want to emphasize how url will be matched though: loader will resolve dependencies to their absolute url, based on its base url. So if the router base url is at '.'
and you want ignore something
at src/something
, it should be done by:
ignoreDependencies('src/something');
Something like that?
@EisenbergEffect The feature being described here isn't finished yet. I'm not sure this change should be going live yet.
Yes, there are subtle differences between webpack-loader / default-loader that I haven't been able to address. I've put it on hold so far. Default loader seems to be harder to debug than I imagined
Apologies! I've reverted the documentation so it doesn't go out on Monday. Sorry for the hassle, but when it's ready can you submit a new PR? Thank you.
This describes a new feature of aurelia-testing introduced by https://github.com/aurelia/testing/pull/89