forked from angular-redux/store
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port tests to jasmine (angular-redux#364)
* port tests to jasmine * coverage threshold, linter fixes * remove need for proxyquire
- Loading branch information
1 parent
fd5f64d
commit 5f85b23
Showing
15 changed files
with
2,240 additions
and
962 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module.exports = function(config) { | ||
config.set({ | ||
frameworks: ['jasmine', 'karma-typescript'], | ||
files: [ | ||
{ pattern: 'src/base.spec.ts' }, | ||
{ pattern: 'src/**/*.ts' }, | ||
], | ||
preprocessors: { | ||
'**/*.ts': ['karma-typescript'], | ||
}, | ||
karmaTypescriptConfig: { | ||
bundlerOptions: { | ||
entrypoints: /\.spec\.ts$/, | ||
transforms: [ require('karma-typescript-angular2-transform') ], | ||
}, | ||
compilerOptions: { | ||
lib: ['ES2015', 'DOM'], | ||
}, | ||
coverageOptions: { | ||
instrumentation: true, | ||
threshold: { | ||
global: { | ||
statements: 70, | ||
branches: 70, | ||
functions: 60, | ||
lines: 70, | ||
excludes: [ 'src/**/*.js' ], | ||
}, | ||
}, | ||
}, | ||
}, | ||
reporters: ['progress', 'karma-typescript'], | ||
browsers: ['Chrome'], | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,14 +4,13 @@ | |
"description": "Angular 2 bindings for Redux", | ||
"main": "./lib/index.js", | ||
"scripts": { | ||
"prebuild": "rimraf ./lib; npm uninstall @types/chai @types/sinon-chai;", | ||
"postbuild": "npm install @types/[email protected] @types/[email protected]; rimraf \"src/**/*.ngfactory.ts\"", | ||
"prebuild": "rimraf ./lib", | ||
"postbuild": "rimraf \"src/**/*.ngfactory.ts\"", | ||
"build": "ngc -p tsconfig.json;", | ||
"test": "rimraf coverage && npm run lint && npm run cover", | ||
"mocha": "mocha --opts mocha.opts", | ||
"lint": "tslint 'src/**/*.ts' 'examples/counter/**.ts' --exclude 'examples/counter/node_modules'", | ||
"cover": "NODE_ENV=test nyc npm run mocha", | ||
"prepublish": "npm test && npm run build" | ||
"prepublish": "npm test && npm run build", | ||
"test": "karma start ./karma.conf.js --single-run", | ||
"test:watch": "karma start ./karma.conf.js" | ||
}, | ||
"typings": "./lib/index.d.ts", | ||
"repository": { | ||
|
@@ -56,58 +55,27 @@ | |
"@angular/core": "^4.0.0", | ||
"@angular/platform-browser": "^4.0.0", | ||
"@angular/platform-browser-dynamic": "^4.0.0", | ||
"@types/chai": "^3.4.31", | ||
"@types/mocha": "^2.2.30", | ||
"@types/jasmine": "2.5.38", | ||
"@types/node": "^6.0.36", | ||
"@types/sinon": "^1.16.28", | ||
"@types/sinon-chai": "^2.7.26", | ||
"awesome-typescript-loader": "^2.2.1", | ||
"chai": "^3.5.0", | ||
"es6-shim": "^0.35.0", | ||
"mocha": "^2.4.5", | ||
"nyc": "^8.1.0", | ||
"proxyquire": "^1.7.10", | ||
"core-js": "^2.4.1", | ||
"jasmine-core": "~2.5.2", | ||
"karma": "~1.4.1", | ||
"karma-chrome-launcher": "~2.0.0", | ||
"karma-cli": "~1.0.1", | ||
"karma-jasmine": "^1.1.0", | ||
"karma-typescript": "^3.0.0", | ||
"karma-typescript-angular2-transform": "^1.0.0", | ||
"redux": "^3.5.0", | ||
"reflect-metadata": "0.1.3", | ||
"rimraf": "^2.5.2", | ||
"rxjs": "^5.0.1", | ||
"sinon": "^1.16.1", | ||
"sinon-chai": "^2.8.0", | ||
"symbol-observable": "^1.0.1", | ||
"ts-node": "1.3.0", | ||
"tslint": "^3.11.0", | ||
"typescript": "^2.0.0", | ||
"typescript": "^2.1.0", | ||
"zone.js": "^0.8.4" | ||
}, | ||
"peerDependencies": { | ||
"@angular/core": "^2.4.0 || ^4.0.0", | ||
"redux": "^3.5.0" | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"examples", | ||
"node_modules", | ||
"**/*.spec.ts", | ||
"lib", | ||
"docs", | ||
"coverage", | ||
".nyc_output" | ||
], | ||
"extension": [ | ||
".ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
], | ||
"reporter": [ | ||
"lcov", | ||
"text" | ||
], | ||
"all": true, | ||
"check-coverage": true, | ||
"lines": 60, | ||
"branches": 60, | ||
"functions": 60, | ||
"statements": 60 | ||
} | ||
} |
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,19 @@ | ||
import 'core-js'; | ||
import 'zone.js/dist/zone'; | ||
import 'zone.js/dist/long-stack-trace-zone'; | ||
import 'zone.js/dist/proxy'; | ||
import 'zone.js/dist/sync-test'; | ||
import 'zone.js/dist/jasmine-patch'; | ||
import 'zone.js/dist/async-test'; | ||
import 'zone.js/dist/fake-async-test'; | ||
import 'reflect-metadata'; | ||
|
||
import { TestBed } from '@angular/core/testing'; | ||
import { | ||
BrowserDynamicTestingModule, | ||
platformBrowserDynamicTesting | ||
} from '@angular/platform-browser-dynamic/testing'; | ||
|
||
TestBed.initTestEnvironment( | ||
BrowserDynamicTestingModule, | ||
platformBrowserDynamicTesting()); |
Oops, something went wrong.