I get this strange error message when I tried to run a test for my component. Promise rejected during “MY_COMPONENT_TEST”: Cannot call render
without having first called setupRenderingContext
. I followed what has been mentioned in the ember component test documentation. I have called setupRenderingTest(hooks). But still getting this weird error message when running tests. But the test works fine when I remove rendering the component using the render method. I also get the following error messages Promise rejected before “MY_COMPONENT_TEST”: appContainer is undefined, Promise rejected before “MY_COMPONENT_TEST”: owner is undefined, Promise rejected before “MY_COMPONENT_TEST”: right-hand side of ‘in’ should be an object, got undefined.
I found an error and may be due to this why ember fails to get a context to render the component when I run component test.
export function initialize( application) {
let appContainer = application.__container__;
console.log("AppContainer is", appContainer); //undefined
}
export default {
initialize
};
This is my initializer file where when I access the __container__
of the application I get undefined. This code is part of an addon.
2 posts - 2 participants