From d28ce50067571de97f2f3d2101d6ece256c8a642 Mon Sep 17 00:00:00 2001 From: Olivier Combe Date: Mon, 26 Mar 2018 19:05:39 +0200 Subject: [PATCH] test(ivy): make sure `goog.getMsg()` is defined before being used (#22998) PR Close #22998 --- .../hello_world/bundle.golden_symbols.json | 2 +- .../core/test/bundling/hello_world/index.ts | 2 +- .../bundling/hello_world_i18n/BUILD.bazel | 12 +++++----- .../test/bundling/hello_world_i18n/index.html | 22 +++++++++++++------ .../test/bundling/hello_world_i18n/index.ts | 11 +--------- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/packages/core/test/bundling/hello_world/bundle.golden_symbols.json b/packages/core/test/bundling/hello_world/bundle.golden_symbols.json index ae402bdc49..9a2bfbbfa7 100644 --- a/packages/core/test/bundling/hello_world/bundle.golden_symbols.json +++ b/packages/core/test/bundling/hello_world/bundle.golden_symbols.json @@ -27,7 +27,7 @@ "name": "HelloWorld" }, { - "name": "INeedToExistEvenThoughtIAmNotNeeded" + "name": "INeedToExistEvenThoughIAmNotNeeded" }, { "name": "Immediate" diff --git a/packages/core/test/bundling/hello_world/index.ts b/packages/core/test/bundling/hello_world/index.ts index 47d9450b04..b052b5302f 100644 --- a/packages/core/test/bundling/hello_world/index.ts +++ b/packages/core/test/bundling/hello_world/index.ts @@ -14,7 +14,7 @@ export class HelloWorld { // TODO(misko): Forgetting to export HelloWorld and not having NgModule fails silently. @NgModule({declarations: [HelloWorld]}) -export class INeedToExistEvenThoughtIAmNotNeeded { +export class INeedToExistEvenThoughIAmNotNeeded { } // TODO(misko): Package should not be required to make this work. diff --git a/packages/core/test/bundling/hello_world_i18n/BUILD.bazel b/packages/core/test/bundling/hello_world_i18n/BUILD.bazel index cc886bbaef..0e57b04e2e 100644 --- a/packages/core/test/bundling/hello_world_i18n/BUILD.bazel +++ b/packages/core/test/bundling/hello_world_i18n/BUILD.bazel @@ -14,7 +14,12 @@ ivy_ng_module( ng_rollup_bundle( name = "bundle", - # Remove once #22913 lands + # TODO(alexeagle): This is inconsistent. + # We try to teach users to always have their workspace at the start of a + # path, to disambiguate from other workspaces. + # Here, the rule implementation is looking in an execroot where the layout + # has an "external" directory for external dependencies. + # This should probably start with "angular/" and let the rule deal with it. entry_point = "packages/core/test/bundling/hello_world_i18n/index.js", deps = [ ":hello_world_i18n", @@ -29,8 +34,5 @@ ts_devserver( ":bundle.min.js", "index.html", ], - deps = [ - # fix for ibazel until https://github.com/angular/angular/pull/22912 gets merged - "//packages/compiler", - ], + deps = [], ) diff --git a/packages/core/test/bundling/hello_world_i18n/index.html b/packages/core/test/bundling/hello_world_i18n/index.html index c5c7bb3e0b..e846acca41 100644 --- a/packages/core/test/bundling/hello_world_i18n/index.html +++ b/packages/core/test/bundling/hello_world_i18n/index.html @@ -8,11 +8,11 @@ - - \ No newline at end of file + diff --git a/packages/core/test/bundling/hello_world_i18n/index.ts b/packages/core/test/bundling/hello_world_i18n/index.ts index c1c4012014..307b59f51d 100644 --- a/packages/core/test/bundling/hello_world_i18n/index.ts +++ b/packages/core/test/bundling/hello_world_i18n/index.ts @@ -8,15 +8,6 @@ import {Component, NgModule, ɵrenderComponent as renderComponent} from '@angular/core'; -// simulate translations for now -const translations: {[key: string]: string} = { - 'Hello World!': 'Bonjour Monde!', - 'Hello Title!': 'Bonjour Titre!', -}; - -// simulate Google Closure getMsg for now -(window as any).goog = {getMsg: (key: string) => { return translations[key] || key; }}; - @Component({ selector: 'hello-world', template: `
Hello World!
` @@ -26,7 +17,7 @@ export class HelloWorld { // TODO(misko): Forgetting to export HelloWorld and not having NgModule fails silently. @NgModule({declarations: [HelloWorld]}) -export class INeedToExistEvenThoughtIAmNotNeeded { +export class INeedToExistEvenThoughIAmNotNeeded { } // TODO(misko): Package should not be required to make this work.