store
store copied to clipboard
[Testing] Can't resolve all parameters for MockDevToolsExtension
Hi !
This is a...
- [x] bug report
- [x] usage question
What toolchain are you using for transpilation/bundling?
- [x] angular/cli
Environment
NodeJS Version: 8.9 Typescript Version: 2.4.2 Angular Version: 5 @angular-redux/store version: 7.0.2 angular/cli version: (if applicable) : 1.6.3 OS: Mac
Issue:
Hi, when trying to test a component having a redux actions service, I get Can't resolve all parameters for MockDevToolsExtension
Here is my piece of code (i followed the instructions here) :
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NgReduxTestingModule, MockNgRedux } from '@angular-redux/store/testing';
import { LoginComponent } from './login.component';
import { UserActions } from '../../redux/user';
describe('LoginComponent', () => {
let component: LoginComponent;
let fixture: ComponentFixture<LoginComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoginComponent ],
imports: [NgReduxTestingModule],
providers: [UserActions],
})
.compileComponents();
MockNgRedux.reset();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LoginComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
Conclusion
I'm not sure how to solve this. Do not hesitate if you need more informations.
Thanks !
I'm having the same issue with a near identical setup (only difference is running TypeScript version 2.6.2 and on Windows, also Angular 5). Have there been any updates? Cheers!
Hi all, just commenting again to mention I fixed this issue by upgrading Angular to version 7.