Skip to content

Instantly share code, notes, and snippets.

@robwormald
Created July 18, 2017 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robwormald/12ea08c7d6b96e88ec56a9d8692521e5 to your computer and use it in GitHub Desktop.
Save robwormald/12ea08c7d6b96e88ec56a9d8692521e5 to your computer and use it in GitHub Desktop.
describe(‘My Effects’, () => {
let effects: MyEffects;
let actions: Observable<any>;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
MyEffects,
provideMockActions(() => actions),
// other providers
],
});
effects = TestBed.get(MyEffects);
});
it(‘should work’, () => {
actions = hot(‘—a-’, { a: SomeAction,  … });
const expected = cold(‘—b’, { b: AnotherAction });
expect(effects.someSource$).toBeObservable(expected);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment