Skip to content

Commit

Permalink
test: update ng_package tests to use bundle_dts (#28588)
Browse files Browse the repository at this point in the history
PR Close #28588
  • Loading branch information
alan-agius4 authored and mhevery committed Feb 14, 2019
1 parent 3d39100 commit 3bb3d6d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 58 deletions.
1 change: 1 addition & 0 deletions packages/bazel/test/ng_package/example/BUILD.bazel
Expand Up @@ -5,6 +5,7 @@ load("//tools:defaults.bzl", "ng_module", "ng_package", "npm_package")
ng_module(
name = "example",
srcs = glob(["*.ts"]),
bundle_dts = True,
module_name = "example",
deps = [
"//packages/bazel/test/ng_package/example/secondary",
Expand Down
Expand Up @@ -5,6 +5,7 @@ load("//tools:defaults.bzl", "ng_module")
ng_module(
name = "secondary",
srcs = glob(["*.ts"]),
bundle_dts = True,
module_name = "example/secondary",
deps = [
"//packages/core",
Expand Down
79 changes: 21 additions & 58 deletions packages/bazel/test/ng_package/example_package.golden
Expand Up @@ -42,15 +42,11 @@ fesm5
fesm5/secondary.js.map
fesm5/waffels.js
fesm5/waffels.js.map
index.d.ts
mymodule.d.ts
package.json
secondary
secondary/index.d.ts
secondary/package.json
secondary/secondary.d.ts
secondary/secondary.metadata.json
secondary/secondarymodule.d.ts
secondary.d.ts
secondary.metadata.json
some-file.txt
Expand Down Expand Up @@ -482,14 +478,22 @@ export var a = 1;
--- example.d.ts ---

/**
* Generated bundle index. Do not edit.
* @license Angular v0.0.0
* (c) 2010-2019 Google LLC. https://angular.io/
* License: MIT
*/
export * from './index';



export declare class MyModule {
}

export { }


--- example.metadata.json ---

{"__symbolic":"module","version":4,"metadata":{"MyModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{}]}],"members":{}}},"origins":{"MyModule":"./mymodule"},"importAs":"example"}
{"__symbolic":"module","version":4,"metadata":{"MyModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{}]}],"members":{}}},"origins":{"MyModule":"./example"},"importAs":"example"}

--- extra-styles.css ---

Expand Down Expand Up @@ -653,31 +657,6 @@ export { MyModule };
//# sourceMappingURL=waffels.js.map


--- index.d.ts ---

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export * from './mymodule';


--- mymodule.d.ts ---

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export declare class MyModule {
}


--- package.json ---

{
Expand All @@ -693,18 +672,6 @@ export declare class MyModule {
"es2015": "./fesm2015/example.js"
}

--- secondary/index.d.ts ---

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export * from './secondarymodule';


--- secondary/package.json ---

{
Expand All @@ -722,28 +689,24 @@ export * from './secondarymodule';
--- secondary/secondary.d.ts ---

/**
* Generated bundle index. Do not edit.
* @license Angular v0.0.0
* (c) 2010-2019 Google LLC. https://angular.io/
* License: MIT
*/
export * from './index';


--- secondary/secondary.metadata.json ---

{"__symbolic":"module","version":4,"metadata":{"SecondaryModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{}]}],"members":{}},"a":1},"origins":{"SecondaryModule":"./secondarymodule","a":"./secondarymodule"},"importAs":"example/secondary"}
export declare const a = 1;

--- secondary/secondarymodule.d.ts ---

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export declare class SecondaryModule {
}
export declare const a = 1;

export { }


--- secondary/secondary.metadata.json ---

{"__symbolic":"module","version":4,"metadata":{"SecondaryModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{}]}],"members":{}},"a":1},"origins":{"SecondaryModule":"./secondary","a":"./secondary"},"importAs":"example/secondary"}

--- secondary.d.ts ---

Expand Down

0 comments on commit 3bb3d6d

Please sign in to comment.