Last active
January 25, 2017 23:47
-
-
Save icfantv/56736d21d1a715e7476ec2e1c0ec863b to your computer and use it in GitHub Desktop.
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
import {NgModule, Type} from '@angular/core'; | |
import {BrowserModule} from '@angular/platform-browser'; | |
import {UpgradeModule, downgradeInjectable} from '@angular/upgrade/static'; | |
import {SPINNAKER_DOWNGRADES} from './modules'; | |
declare let angular: any; | |
const providers: Type<any>[] = []; | |
SPINNAKER_DOWNGRADES.forEach((item) => { | |
providers.push(item.moduleClass); | |
angular.module(item.moduleName, []).factory(item.injectionName, downgradeInjectable(item.moduleClass)); | |
}); | |
@NgModule({ | |
imports: [ | |
BrowserModule, | |
UpgradeModule | |
], | |
providers: [ | |
...providers | |
] | |
}) | |
export class SpinnakerModule { | |
ngDoBootstrap() {} | |
} |
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
'use strict'; | |
// define TS-generated helper code once for the app rather than in every file | |
// this also requires `noEmitHelpers: true` to be set in tsconfig.json | |
// this can be removed when switching to TS 2.1 | |
// https://github.com/ngParty/ts-helpers | |
import 'ts-helpers'; | |
import * as angular from 'angular'; | |
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; | |
import {UpgradeModule} from '@angular/upgrade/static'; | |
import {SpinnakerModule} from './app.module'; | |
import {APPENGINE_MODULE} from './modules/appengine/appengine.module'; | |
module.exports = angular.module('netflix.spinnaker', [ | |
require('./modules/netflix/netflix.module.js'), | |
require('./modules/core/core.module.js'), | |
require('./modules/amazon/aws.module.js'), | |
require('./modules/google/gce.module.js'), | |
require('./modules/cloudfoundry/cf.module.js'), | |
require('./modules/titus/titus.module.js'), | |
require('./modules/azure/azure.module.js'), | |
require('./modules/kubernetes/kubernetes.module.js'), | |
require('./modules/openstack/openstack.module.js'), | |
require('./modules/docker/docker.module.js'), | |
APPENGINE_MODULE, | |
]); | |
platformBrowserDynamic().bootstrapModule(SpinnakerModule).then(platformRef => { | |
const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule; | |
upgrade.bootstrap(document.body, ['netflix.spinnaker']); | |
}); |
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
@ ./app/scripts \.spec\.(js|ts)$ | |
@ ./karma-shim.js | |
Chrome 55.0.2883 (Mac OS X 10.12.3) authenticationInterceptor non-intercepted requests resolves immediately for auth endpoint FAILED | |
Error: [$injector:unpr] Unknown provider: $$angularInjectorProvider <- $$angularInjector <- authenticationService | |
http://errors.angularjs.org/1.5.11/$injector/unpr?p0=%24%24angularInjectorProvider%20%3C-%20%24%24angularInjector%20%3C-%20authenticationService | |
at karma-shim.js:156230:12 | |
at karma-shim.js:160725:19 | |
at Object.getService [as get] (karma-shim.js:160878:32) | |
at karma-shim.js:160730:45 | |
at getService (karma-shim.js:160878:32) | |
at injectionArgs (karma-shim.js:160903:58) | |
at Object.invoke (karma-shim.js:160925:18) | |
at Object.enforcedReturnValue [as $get] (karma-shim.js:160771:37) | |
at Object.invoke (karma-shim.js:160933:19) | |
at karma-shim.js:160731:37 | |
at getService (karma-shim.js:160878:32) | |
at injectionArgs (karma-shim.js:160903:58) | |
at Object.invoke (karma-shim.js:160925:18) | |
at Object.WorkFn (karma-shim.js:120127:20) | |
at ZoneDelegate.invoke (karma-shim.js:130056:26) | |
at ProxyZoneSpec.onInvoke (karma-shim.js:129710:39) | |
at ZoneDelegate.invoke (karma-shim.js:130055:32) | |
at Zone.run (karma-shim.js:129927:43) | |
at Object.<anonymous> (karma-shim.js:129425:34) | |
at ZoneQueueRunner.jasmine.QueueRunner.ZoneQueueRunner.execute (karma-shim.js:129455:42) | |
at ZoneQueueRunner.jasmine.QueueRunner.ZoneQueueRunner.execute (karma-shim.js:129455:42) | |
at ZoneQueueRunner.jasmine.QueueRunner.ZoneQueueRunner.execute (karma-shim.js:129455:42) | |
at karma-shim.js:129452:130 | |
at ZoneDelegate.invokeTask (karma-shim.js:130089:35) | |
at Zone.runTask (karma-shim.js:129965:47) | |
at drainMicroTaskQueue (karma-shim.js:130247:35) | |
Error: Declaration Location | |
at Object.window.inject.angular.mock.inject (karma-shim.js:120090:25) [syncTestZone for jasmine.describe] | |
at Suite.<anonymous> (karma-shim.js:274243:31) [syncTestZone for jasmine.describe] | |
at Zone.run (karma-shim.js:129927:43) [<root> => syncTestZone for jasmine.describe] | |
at Suite.<anonymous> (karma-shim.js:129412:29) [<root>] | |
at Env.jasmineEnv.(anonymous function) [as describe] (karma-shim.js:129389:38) [<root>] | |
at Object.<anonymous> (karma-shim.js:274240:1) [<root>] | |
at __webpack_require__ (karma-shim.js:20:30) [<root>] | |
at webpackContext (karma-shim.js:116884:9) [<root>] | |
at Array.forEach (native) [<root>] | |
at Object.<anonymous> (karma-shim.js:280186:20) [<root>] | |
at Object.<anonymous> (karma-shim.js:280192:30) [<root>] | |
at __webpack_require__ (karma-shim.js:20:30) [<root>] | |
at karma-shim.js:66:18 [<root>] | |
at karma-shim.js:69:10 [<root>] | |
TypeError: Cannot read property 'authEndpoint' of undefined | |
at Object.<anonymous> (karma-shim.js:274252:42) | |
at ZoneDelegate.invoke (karma-shim.js:130056:26) | |
at ProxyZoneSpec.onInvoke (karma-shim.js:129710:39) | |
at ZoneDelegate.invoke (karma-shim.js:130055:32) | |
at Zone.run (karma-shim.js:129927:43) | |
at Object.<anonymous> (karma-shim.js:129425:34) | |
at ZoneDelegate.invoke (karma-shim.js:130056:26) | |
at ProxyZoneSpec.onInvoke (karma-shim.js:129710:39) | |
at ZoneDelegate.invoke (karma-shim.js:130055:32) | |
at Zone.run (karma-shim.js:129927:43) | |
at Object.<anonymous> (karma-shim.js:129425:34) | |
at ZoneQueueRunner.jasmine.QueueRunner.ZoneQueueRunner.execute (karma-shim.js:129455:42) | |
at ZoneQueueRunner.jasmine.QueueRunner.ZoneQueueRunner.execute (karma-shim.js:129455:42) | |
at ZoneQueueRunner.jasmine.QueueRunner.ZoneQueueRunner.execute (karma-shim.js:129455:42) | |
at karma-shim.js:129452:130 | |
at ZoneDelegate.invokeTask (karma-shim.js:130089:35) | |
at Zone.runTask (karma-shim.js:129965:47) | |
at drainMicroTaskQueue (karma-shim.js:130247:35) | |
Chrome 55.0.2883 (Mac OS X 10.12.3): Executed 1 of 1242 (1 FAILED) (skipped 1241) ERROR (0.233 secs / 0.025 secs) |
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
Error.stackTraceLimit = Infinity; | |
// jquery has to be first or many a test will break | |
global.$ = global.jQuery = require('jquery'); | |
// angular 1 test harnesss | |
require('angular'); | |
require('angular-mocks'); | |
// polyfills | |
require('core-js/es6'); | |
require('core-js/es7/reflect'); | |
// not sure, but angular 2 says these are required | |
// there's definitely some overlap with the polyfills | |
require('core-js/client/shim'); | |
require('reflect-metadata'); | |
// for consolidating TS-generated helpers | |
require('ts-helpers'); | |
require('zone.js/dist/zone'); | |
require('zone.js/dist/long-stack-trace-zone'); | |
require('zone.js/dist/proxy'); | |
require('zone.js/dist/sync-test'); | |
require('zone.js/dist/jasmine-patch'); | |
require('zone.js/dist/async-test'); | |
require('zone.js/dist/fake-async-test'); | |
require('rxjs/Rx'); | |
require('./settings.js'); | |
require('./app/scripts/app.module'); | |
const testContext = require.context('./app/scripts/', true, /\.spec\.(js|ts)$/); | |
testContext.keys().forEach(testContext); | |
const testing = require('@angular/core/testing'); | |
const browser = require('@angular/platform-browser-dynamic/testing'); | |
testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment