Skip to content

Commit

Permalink
fix(build): Get tests running for each project
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRyanDev authored and brandonroberts committed Apr 11, 2017
1 parent f86e2b4 commit c4a1054
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
12 changes: 5 additions & 7 deletions modules/effects/spec/actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import 'rxjs/add/operator/toArray';
import 'rxjs/add/operator/map';
import 'rxjs/add/observable/of';
import { ReflectiveInjector } from '@angular/core';
import { Action, StoreModule, ActionsSubject } from '@ngrx/store';

import { Action, StoreModule, ScannedActionsSubject, ActionsSubject } from '@ngrx/store';
import { Actions } from '../src/actions';


describe('Actions', function() {
let actions$: Actions;
let dispatcher: ActionsSubject;
let dispatcher: ScannedActionsSubject;

const ADD = 'ADD';
const SUBTRACT = 'SUBTRACT';
Expand All @@ -33,10 +32,10 @@ describe('Actions', function() {
]);

actions$ = injector.get(Actions);
dispatcher = injector.get(ActionsSubject);
dispatcher = injector.get(ScannedActionsSubject);
});

xit('should be an observable of actions', function() {
it('should be an observable of actions', function() {
const actions = [
{ type: ADD },
{ type: SUBTRACT },
Expand All @@ -45,7 +44,6 @@ describe('Actions', function() {
];

let iterations = [
{ type: ActionsSubject.INIT },
...actions
];

Expand All @@ -59,7 +57,7 @@ describe('Actions', function() {
actions.forEach(action => dispatcher.next(action));
});

xit('should let you filter out actions', function() {
it('should let you filter out actions', function() {
const actions = [ ADD, ADD, SUBTRACT, ADD, SUBTRACT ];
const expected = actions.filter(type => type === ADD);

Expand Down
6 changes: 2 additions & 4 deletions modules/effects/src/actions.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// TODO: This is a copy of this: https://github.com/redux-observable/redux-observable/blob/master/src/ActionsObservable.js
// Remove after this is resolved: https://github.com/redux-observable/redux-observable/issues/95
import { Injectable, Inject } from '@angular/core';
import { Action, ActionsSubject } from '@ngrx/store';
import { Action, ScannedActionsSubject } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import { Operator } from 'rxjs/Operator';
import { filter } from 'rxjs/operator/filter';


@Injectable()
export class Actions extends Observable<Action> {
constructor(@Inject(ActionsSubject) actionsSubject: Observable<Action>) {
constructor(@Inject(ScannedActionsSubject) actionsSubject: Observable<Action>) {
super();
this.source = actionsSubject;
}
Expand Down
3 changes: 1 addition & 2 deletions tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ require('zone.js/dist/jasmine-patch.js');
const { getTestBed } = require('@angular/core/testing');
const { ServerTestingModule, platformServerTesting } = require('@angular/platform-server/testing');


getTestBed().initTestEnvironment(ServerTestingModule, platformServerTesting());

runner.loadConfig({
spec_dir: 'spec',
spec_files: [ '**/*.spec.ts' ]
});

runner.execute();
runner.execute();

0 comments on commit c4a1054

Please sign in to comment.