Skip to content

Commit 7ca3196

Browse files
committed
updated tests to pass automatically because of some coverage and types issues
1 parent e3e4fd0 commit 7ca3196

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

addon/ng2/blueprints/ng2/files/__path__/test.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/*global jasmine, __karma__, window*/
23
require('core-js/es6');
34
require('core-js/es7/reflect');
@@ -15,22 +16,25 @@ require('zone.js/dist/sync-test');
1516
// RxJS
1617
require('rxjs/Rx');
1718

18-
let testing: any = require('@angular/core/testing');
19-
let browser: any = require('@angular/platform-browser-dynamic/testing');
19+
Promise.all([
20+
System.import('@angular/core/testing'),
21+
System.import('@angular/platform-browser-dynamic/testing')
22+
]).then(function (providers) {
23+
let testing = providers[0];
24+
let testingBrowser = providers[1];
2025

21-
testing.setBaseTestProviders(
22-
browser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
23-
browser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS
24-
);
26+
testing.setBaseTestProviders(testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
27+
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
28+
});
2529

26-
let testContext: any = require.context('../src', true, /\.spec\.ts/);
30+
let testContext = require.context('../src', true, /\.spec\.ts/);
2731

2832
/*
2933
* get all the files, for each file, call the context function
3034
* that will require the file and load it up here. Context will
3135
* loop and require those spec files here
3236
*/
33-
function requireAll(requireContext: any) {
37+
function requireAll(requireContext) {
3438
return requireContext.keys().map(requireContext);
3539
}
3640

addon/ng2/blueprints/ng2/files/__path__/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"experimentalDecorators": true,
77
"module": "es6",
88
"target": "es5",
9-
"lib": ["es6", "dom"],
109
"moduleResolution": "node",
1110
"outDir": "./dist/",
1211
"rootDir": ".",
@@ -19,6 +18,6 @@
1918
"bower_components"
2019
],
2120
"files": [
22-
"./src/typings.d.ts"
21+
"typings.d.ts"
2322
]
2423
}

addon/ng2/blueprints/ng2/files/__path__/typings.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html
55

66
/// <reference path="<%= refToTypings %>/typings/browser.d.ts" />
7+
/// <reference path="../node_modules/typescript/lib/lib.es2015.core.d.ts" />
8+
/// <reference path="../node_modules/typescript/lib/lib.es2015.collection.d.ts" />
9+
/// <reference path="../node_modules/typescript/lib/lib.es2015.promise.d.ts" />
10+
711
<% if(!isMobile) { %>
812
declare var module: { id: string };
913
declare var require: any;

addon/ng2/models/webpack-karma-config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function(config) {
1616
preprocessors: { './config/spec-bundle.js': ['coverage', 'webpack', 'sourcemap'] },
1717
webpack: testWebpackConfig,
1818
webpackServer: { noInfo: true },
19-
reporters: [ 'mocha', 'coverage' ],
19+
reporters: [ 'text-summary', 'mocha', 'coverage' ],
2020
port: 9876,
2121
colors: true,
2222
logLevel: config.LOG_INFO,

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131
"homepage": "https://github.com/angular/angular-cli",
3232
"dependencies": {
3333
"@angular/compiler-cli": "^0.2.0",
34-
"@angularclass/webpack-toolkit": "^1.0.1",
3534
"@types/webpack": "^1.12.22-alpha",
3635
"angular2-template-loader": "^0.4.0",
37-
"awesome-typescript-loader": "^2.0.0-rc.3",
36+
"awesome-typescript-loader": "1.1.1",
3837
"babel-core": "^6.9.1",
3938
"babel-loader": "^6.2.4",
4039
"babel-preset-es2015-webpack": "^6.4.1",

0 commit comments

Comments
 (0)