Platform: Help with effect test

Created on 17 Aug 2017  路  3Comments  路  Source: ngrx/platform

Hi!... How can I test this effect with marble tests?

import 'rxjs/add/operator/map';
import 'rxjs/add/operator/delay';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Action } from '@ngrx/store';
import { Actions, Effect } from '@ngrx/effects';
import { INCREMENT_ASYNC, INCREMENT } from '../actions/counter';

@Injectable()
export class CounterEffects {
  // Listen for the 'INCREMENT_ASYNC' action
  @Effect()
  incrementAsync$: Observable<Action> = this.actions$
    .ofType(INCREMENT_ASYNC)
    .delay(1000)
    .map(() => ({ type: INCREMENT }));

  constructor(private actions$: Actions) {}
}

All 3 comments

@gperdomor I think this is better suited to be posted in https://gitter.im/ngrx/effects

@gperdomor Have you found a solution?

You may needed to add some more details, so this issue may not close. Did you find a fix anyway? I am facing the same issue.

Was this page helpful?
0 / 5 - 0 ratings