-
-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Description
https://aurelia.io/docs/testing/components#using-a-real-parent-view-model
In "A Custom Attribute Test with Real Parent View-model and DI dependencies"
The example is
import {StageComponent} from 'aurelia-testing';
import {bootstrap} from 'aurelia-bootstrapper';
import {MyComponent} from 'src/my-component';
import {Container} from 'aurelia-dependency-injection';
import {MyService} from 'src/my-service';
describe('MyAttribute', () => {
let component;
let container;
let viewModel;
let myService;
beforeEach(() => {
container = new Container();
myService = container.get(MyService);
viewModel = container.get(MyComponent);
component = StageComponent
.withResources('src/my-attribute')
.inView('<div my-attribute.bind="color">Bob</div>')
.boundTo(viewModel);
});
//...
});
Shouldn't the .get calls be .registerInstance instead?
How does StageComponent know about the newly created Container?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels