cypress-angular-unit-test
cypress-angular-unit-test copied to clipboard
Critical dependency: the request of a dependency is an expression
Current behavior
After npx cypress open-ct I get a lot of warnings like this:
WARNING in ./node_modules/@angular/core/fesm2015/core.js 29858:15-102
Critical dependency: the request of a dependency is an expression
and this:
WARNING in ./node_modules/@angular/core/fesm2015/core.js 29858:15-102
System.import() is deprecated and will be removed soon. Use import() instead.
Be use Angular 12.1 with webpack 5.47 and typescript 4.3.
After the built finished with warnings I get an "Root element not found" error in the Component Test.
s.
Desired behavior
A build without warnings and working Component Test without error
Test code to reproduce
` import 'zone.js/dist/zone'; import 'zone.js/dist/long-stack-trace-zone'; import 'zone.js/dist/proxy';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import 'zone.js/dist/zone-testing';
import { initEnv, mount } from 'cypress-angular-unit-test';
import { LoadingIndicatorComponent } from './loading-indicator.component';
describe('LoadingIndicatorComponent', () => {
beforeEach(() => {
initEnv(LoadingIndicatorComponent);
});
it('shows the input', () => {
mount(LoadingIndicatorComponent, {});
cy.contains('Welcome to World!');
});
});`
Versions
Cypress package version: 7.7.0 Cypress binary version: 7.7.0 Electron version: 12.0.0-beta.14 Bundled Node version: 14.15.1
@angular-devkit/architect 0.1201.1 @angular-devkit/build-angular 12.1.1 @angular-devkit/core 12.1.1 @angular-devkit/schematics 12.1.1 @angular/elements 12.1.3 @angular/flex-layout 12.0.0-beta.34 @schematics/angular 12.1.1 rxjs 6.6.7 typescript 4.3.5 webpack 5.47.0
@LeBeatle, were you able to solve the problem?