-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Error with MockBuilder and @angular/cdk DragDropModule #173
Comments
Hi again :) Thanks for the report, I'll take a look tonight and I'll try to provide a fix today or later this week. |
Min test:
import { MockBuilder, MockRender } from 'ng-mocks';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { Component, NgModule } from '@angular/core';
@Component({
selector: 'app-root',
template: 'ng-mocks',
})
export class AppComponent {
}
@NgModule({
imports: [
DragDropModule,
],
declarations: [AppComponent],
})
export class AppModule {
}
describe('AppComponent', () => {
describe('mock DragDropModule', () => {
beforeEach(() => MockBuilder(AppComponent, AppModule));
it('should create the app', () => {
expect(() => MockRender(AppComponent)).not.toThrow();
});
});
}); |
Hi @cdupetit, might you verify that the new build ng-mocks.zip runs on your tests as expected? |
Hi @satanTime, |
Thanks! |
Hi @satanTime,
When I use MockBuilder to test an application with DragDropModule from @angular/cdk.
I get this error :
Error: Unexpected value '[object Object]' exported by the module 'MockOfDragDropModule'
The test run correctly if I use keep(DragDropModule).
You can see the error in StackBlitz.
The code works fine in production.
angular.json
Production :
projects -> demo -> architect -> build -> options -> main -> src/main.ts
Testing :
projects -> demo -> architect -> build -> options -> main -> src/main-testing.ts
Thanks in advance.
Best regards.
Cyril
The text was updated successfully, but these errors were encountered: