Skip to content
This repository has been archived by the owner on Jan 10, 2018. It is now read-only.

Commit

Permalink
build(tests): Run unit tests on node directly via Jasmine
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRyanDev committed Nov 10, 2016
1 parent da6b6cb commit 30544e9
Show file tree
Hide file tree
Showing 4 changed files with 2,738 additions and 55 deletions.
44 changes: 25 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"module": "./index.js",
"scripts": {
"karma": "karma start --single-run",
"test:unit": "npm run karma",
"test:unit": "node tests.js",
"test:ngc": "ngc -p ./spec/ngc/tsconfig.ngc.json",
"test": "npm run test:unit && npm run test:ngc",
"clean:pre": "rimraf release",
Expand Down Expand Up @@ -35,42 +35,48 @@
},
"homepage": "https://github.com/ngrx/store#readme",
"peerDependencies": {
"@angular/core": "^2.0.0",
"rxjs": "^5.0.0-beta.12",
"@ngrx/core": "^1.1.0"
"@angular/core": "^2.1.0",
"@ngrx/core": "^1.1.0",
"rxjs": "^5.0.0-beta.12"
},
"devDependencies": {
"@angular/common": "^2.0.0",
"@angular/compiler": "^2.0.0",
"@angular/compiler-cli": "^0.6.0",
"@angular/core": "^2.0.0",
"@angular/platform-browser": "^2.0.0",
"@angular/platform-browser-dynamic": "^2.0.0",
"@angular/platform-server": "^2.0.0",
"@angular/common": "^2.1.0",
"@angular/compiler": "^2.1.0",
"@angular/compiler-cli": "^2.1.0",
"@angular/core": "^2.1.0",
"@angular/platform-browser": "^2.1.0",
"@angular/platform-browser-dynamic": "^2.1.0",
"@angular/platform-server": "^2.1.0",
"@ngrx/core": "^1.2.0",
"@types/jasmine": "^2.2.33",
"@types/node": "^6.0.38",
"awesome-typescript-loader": "^2.2.1",
"core-js": "^2.4.1",
"cpy-cli": "^1.0.1",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine": "^2.5.0",
"karma": "^1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-mocha-reporter": "^2.1.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.8.0",
"jasmine": "^2.5.2",
"nyc": "^8.3.2",
"rimraf": "^2.5.4",
"rollup": "^0.34.13",
"rxjs": "^5.0.0-beta.11",
"ts-loader": "^0.8.2",
"ts-node": "^1.6.1",
"tslint": "^3.15.1",
"tslint-loader": "^2.1.5",
"typescript": "^2.0.2",
"uglifyjs": "^2.4.10",
"webpack": "^2.1.0-beta.21",
"zone.js": "^0.6.17"
},
"nyc": {
"extension": [
".ts"
],
"exclude": [
"spec/**/*.spec"
],
"include": [
"src/**/*.ts"
]
}
}
36 changes: 0 additions & 36 deletions tests.bundle.ts

This file was deleted.

29 changes: 29 additions & 0 deletions tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require('ts-node/register');
require('core-js/es7/reflect');
require('zone.js/dist/zone-node.js');
require('zone.js/dist/long-stack-trace-zone.js');
require('zone.js/dist/proxy.js');
require('zone.js/dist/sync-test.js');
require('zone.js/dist/async-test.js');
require('zone.js/dist/fake-async-test.js');
const Jasmine = require('jasmine');

const runner = new Jasmine();

global.jasmine = runner.jasmine;

require('zone.js/dist/jasmine-patch.js');
require('./spec/helpers/test-helper.ts');

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();
Loading

0 comments on commit 30544e9

Please sign in to comment.