I using ngx-socket-io and it's working fine in development. But I'm having a problem when I run the ng test.
It gives me error NullInjectorError: No provider for WrappedSocket!
Here is my spec.ts
const IO_CONFIG:SocketIoConfig = {url:'http://localhost:3000,options:{}}
describe(...,()=>{
beforeEach(()=>{
TestBed.configureTestingModule({
imports:[
...
SocketIoModule.forRoot(IO_CONFIG)
...
]
})
})
})
try to add this code to "imports"
SocketIoModule.forRoot({ url: environment.apiUrl, options: { transports: ['websocket'], reconnection: true } })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With