Versions after 10.1.0 give module error for existing tests
See original GitHub issueThis basic test has been in place for a while but now throws an error if I upgrade shallow-render to a version after 10.1.0.
Error:
FAIL src/app/profile/mixcloud-widget/mixcloud-widget.component.spec.ts (9.021 s)
● MixcloudWidgetComponent › should create
Component ProfilesComponent is not part of any NgModule or the module has not been imported into your module.
ProfilesComponent is another component declared within the same module as the component being tested, but neither use each other. I have the same error with other components in other modules. I’ve tried every version up to and including 10.1.4 and get the same result.
The test:
import { Shallow } from 'shallow-render';
import { MixcloudWidgetComponent } from './mixcloud-widget.component';
import { ProfileModule } from '../profile.module';
describe('MixcloudWidgetComponent', () => {
let shallow: Shallow<MixcloudWidgetComponent>;
beforeEach(() => {
shallow = new Shallow(MixcloudWidgetComponent, ProfileModule);
});
it('should create', async () => {
const { element } = await shallow.render();
expect(element.nativeElement).toBeTruthy();
});
});
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Upgrade to cypress 10 for typescript project broken (from 9.6)
When I upgrade our existing typescript project it fails with various typescript errors (see the issue listed above).
Read more >Cypress 10 Upgrade - TestersDock
In this article, I will discuss in detail how I upgraded my current project to cypress 10 along with the issues I faced....
Read more >IBM Workload Scheduler Version 10.1.0 Release Notes
The Release Notes for IBM Workload Scheduler, version 10.1.0 contain the following topics: Interoperability tables; Fix packs; Software limitations and ...
Read more >Manager 10.1.0 Release Notes - Tosca - Tricentis
When executing tests in an existing Tosca TestEvent, you must now trigger or schedule the entire corresponding Test Cycle in qTest. This ...
Read more >Changelog - Cypress Documentation
When a chromium based browser tab or process crashes, Cypress will no longer hang indefinitely but will fail the current test and move...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, I’m browsing the changes since version 10.0.0: https://github.com/getsaf/shallow-render/compare/v10.0.0...master
Nothing jumps out at me that indicates a changes the way components in modules are handled except for some new provider-mocking logic but I will continue to look. Might be tomorrow before I figure it out. If you happen see anything in that diff that looks weird, let me know.
Thanks, for the details, someone else mentioned this in another post recently too. I will look into it. First thing I need to do is to reproduce the issue so I’ll try to mirror your module setup to see if I can get the same error.