-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Effects): Introduce new Effects testing module (#70)
- Loading branch information
1 parent
d176a11
commit 7dbb571
Showing
14 changed files
with
402 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
export interface PackageDescription { | ||
name: string, | ||
hasTestingModule: boolean, | ||
} | ||
|
||
export interface Config { | ||
packages: string[]; | ||
packages: PackageDescription[]; | ||
scope: string; | ||
} | ||
|
||
export const packages = [ | ||
'store', | ||
'effects', | ||
'router-store', | ||
'store-devtools', | ||
export const packages: PackageDescription[] = [ | ||
{ | ||
name: 'store', | ||
hasTestingModule: false, | ||
}, | ||
{ | ||
name: 'effects', | ||
hasTestingModule: true, | ||
}, | ||
{ | ||
name: 'router-store', | ||
hasTestingModule: false, | ||
}, | ||
{ | ||
name: 'store-devtools', | ||
hasTestingModule: false, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@ngrx/effects/testing | ||
======= | ||
|
||
The sources for this package are in the main [ngrx/platform](https://github.com/ngrx/platform) repo. Please file issues and pull requests against that repo. | ||
|
||
License: MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src/testing'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "@ngrx/effects/testing", | ||
"typings": "../testing.d.ts", | ||
"main": "../bundles/effects-testing.umd.js", | ||
"module": "../@ngrx/effects/testing.es5.js", | ||
"es2015": "../@ngrx/effects/testing.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default { | ||
entry: './dist/effects/@ngrx/effects/testing.es5.js', | ||
dest: './dist/effects/bundles/effects-testing.umd.js', | ||
format: 'umd', | ||
exports: 'named', | ||
moduleName: 'ngrx.effects.testing', | ||
globals: { | ||
'@angular/core': 'ng.core', | ||
'@ngrx/effects': 'ngrx.effects', | ||
'rxjs/Observable': 'Rx', | ||
'rxjs/observable/defer': 'Rx.Observable.defer', | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Provider } from '@angular/core'; | ||
import { Actions } from '@ngrx/effects'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import { defer } from 'rxjs/observable/defer'; | ||
|
||
|
||
export function provideMockActions(source: Observable<any>): Provider; | ||
export function provideMockActions(factory: () => Observable<any>): Provider; | ||
export function provideMockActions(factoryOrSource: (() => Observable<any>) | Observable<any>): Provider { | ||
return { | ||
provide: Actions, | ||
useFactory: (): Observable<any> => { | ||
if (typeof factoryOrSource === 'function') { | ||
return defer(factoryOrSource); | ||
} | ||
|
||
return factoryOrSource; | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "../tsconfig-build", | ||
"compilerOptions": { | ||
"paths": { | ||
"@ngrx/store": ["../../dist/packages/store"], | ||
"@ngrx/effects": ["../../dist/packages/effects"] | ||
} | ||
}, | ||
"files": [ | ||
"index.ts" | ||
], | ||
"angularCompilerOptions": { | ||
"strictMetadataEmit": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.