build: update to rules_typescript 0.25.1 (#28896)

* build_bazel_rules_typescript renamed to npm_bazel_typescript
* build_bazel_rules_karma renamed to npm_bazel_karma
* browser_repositories.bzl removed and now using @npm_bazel_karma//:browser_repositories.bzl
* includes some fixes for future ts_library devmode es2015 support but some failure still remain when devmode is es2015 so this PR keeps it as es5 using the bazelOptions.devmodeTargetOverride tsconfig setting

PR Close #28896
This commit is contained in:
Greg Magolan
2019-02-08 14:01:51 -08:00
committed by Ben Lesh
parent d0018e6bf6
commit d91ecd2c8b
89 changed files with 231 additions and 499 deletions

View File

@ -3,7 +3,7 @@ package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ng_rollup_bundle", "ts_library")
load("//tools/http-server:http_server.bzl", "http_server")
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver")
ng_module(
name = "todo",

View File

@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ng_rollup_bundle", "ts_library")
load("//tools/http-server:http_server.bzl", "http_server")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver")
ng_module(
name = "todo_i18n",

View File

@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "jasmine_node_test", "ng_module", "ng_rollup_bundle", "ts_library")
load("//tools/http-server:http_server.bzl", "http_server")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")
load("@npm_bazel_typescript//:defs.bzl", "ts_devserver")
ng_module(
name = "todo",

View File

@ -11,6 +11,14 @@ import {Component, ContentChildren, Directive, Inject, NO_ERRORS_SCHEMA, NgModul
import {TestBed} from '@angular/core/testing';
import {expect} from '@angular/platform-browser/testing/src/matchers';
class Frame {
name: string = 'frame';
}
class ModuleFrame {
name: string = 'moduleFram';
}
describe('forwardRef integration', function() {
beforeEach(() => { TestBed.configureTestingModule({imports: [Module], declarations: [App]}); });
@ -51,14 +59,6 @@ class Door {
constructor(@Inject(forwardRef(() => Frame)) frame: Frame) { this.frame = frame; }
}
class Frame {
name: string = 'frame';
}
class ModuleFrame {
name: string = 'moduleFram';
}
@Directive({selector: 'lock'})
class Lock {
name: string = 'lock';

View File

@ -15,10 +15,6 @@ class TestObj {
someComplexFunc(a: any) { return a; }
}
class SpyTestObj extends SpyObject {
constructor() { super(TestObj); }
}
{
describe('testing', () => {
describe('should respect custom equality tester', () => {
@ -87,7 +83,7 @@ class SpyTestObj extends SpyObject {
describe('spy objects', () => {
let spyObj: any;
beforeEach(() => { spyObj = new SpyTestObj(); });
beforeEach(() => { spyObj = new SpyObject(TestObj); });
it('should return a new spy func with no calls',
() => { expect(spyObj.spy('someFunc')).not.toHaveBeenCalled(); });
@ -100,6 +96,7 @@ class SpyTestObj extends SpyObject {
});
it('should match multiple function calls', () => {
spyObj.spy('someFunc');
spyObj.someFunc(1, 2);
spyObj.someFunc(3, 4);
expect(spyObj.spy('someFunc')).toHaveBeenCalledWith(1, 2);
@ -107,11 +104,13 @@ class SpyTestObj extends SpyObject {
});
it('should match null arguments', () => {
spyObj.spy('someFunc');
spyObj.someFunc(null, 'hello');
expect(spyObj.spy('someFunc')).toHaveBeenCalledWith(null, 'hello');
});
it('should match using deep equality', () => {
spyObj.spy('someComplexFunc');
spyObj.someComplexFunc([1]);
expect(spyObj.spy('someComplexFunc')).toHaveBeenCalledWith([1]);
});
@ -122,8 +121,10 @@ class SpyTestObj extends SpyObject {
expect(s.b()).toEqual(2);
});
it('should create spys for all methods',
() => { expect(() => spyObj.someFunc()).not.toThrow(); });
it('should create spys for all methods', () => {
spyObj.spy('someFunc');
expect(() => spyObj.someFunc()).not.toThrow();
});
});
});
}