Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(testing): add section on ignoring dependencies #389

Merged

Conversation

RomkeVdMeulen
Copy link
Contributor

This describes a new feature of aurelia-testing introduced by aurelia/testing#89

This describes a new feature of aurelia-testing introduced by
aurelia/testing#89
@RomkeVdMeulen
Copy link
Contributor Author

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('');
  });
});

@bigopon
Copy link
Member

bigopon commented Feb 25, 2019

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');

@RomkeVdMeulen
Copy link
Contributor Author

Something like that?

@EisenbergEffect EisenbergEffect merged commit 47bcbc4 into aurelia:master Mar 28, 2019
@RomkeVdMeulen
Copy link
Contributor Author

@EisenbergEffect The feature being described here isn't finished yet. I'm not sure this change should be going live yet.

@bigopon
Copy link
Member

bigopon commented Mar 29, 2019

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

@EisenbergEffect
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants