Skip to content

Commit 77ad737

Browse files
committed
test(@angular/pwa): test with Bazel
1 parent 1f48fe0 commit 77ad737

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
"npm-registry-client": "8.6.0",
127127
"ora": "^4.0.2",
128128
"pacote": "11.1.4",
129+
"parse5-html-rewriting-stream": "5.1.1",
129130
"pidtree": "^0.3.0",
130131
"pidusage": "^2.0.17",
131132
"prettier": "^2.0.0",

packages/angular/pwa/BUILD.bazel

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
licenses(["notice"]) # MIT
77

88
load("@npm_bazel_typescript//:index.bzl", "ts_library")
9+
load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
910
load("//tools:ts_json_schema.bzl", "ts_json_schema")
1011

1112
package(default_visibility = ["//visibility:public"])
@@ -27,10 +28,20 @@ ts_library(
2728
) + [
2829
"//packages/angular/pwa:pwa/schema.ts",
2930
],
31+
data = glob(
32+
include = [
33+
"collection.json",
34+
"package.json",
35+
"pwa/schema.json",
36+
"pwa/files/**/*",
37+
],
38+
),
3039
deps = [
3140
"//packages/angular_devkit/core",
3241
"//packages/angular_devkit/schematics",
42+
"//packages/schematics/angular",
3343
"@npm//@types/node",
44+
"@npm//parse5-html-rewriting-stream",
3445
"@npm//rxjs",
3546
],
3647
)
@@ -39,3 +50,27 @@ ts_json_schema(
3950
name = "pwa_schema",
4051
src = "pwa/schema.json",
4152
)
53+
54+
ts_library(
55+
name = "pwa_test_lib",
56+
testonly = True,
57+
srcs = glob(
58+
include = [
59+
"pwa/**/*_spec.ts",
60+
"pwa/**/*_spec_large.ts",
61+
],
62+
),
63+
# strict_checks = False,
64+
tsconfig = "//:tsconfig-test.json",
65+
deps = [
66+
":pwa",
67+
"//packages/angular_devkit/schematics/testing",
68+
"@npm//@types/jasmine",
69+
"@npm//@types/node",
70+
],
71+
)
72+
73+
jasmine_node_test(
74+
name = "pwa_test",
75+
srcs = [":pwa_test_lib"],
76+
)

packages/angular/pwa/pwa/index_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Schema as PwaOptions } from './schema';
1212
describe('PWA Schematic', () => {
1313
const schematicRunner = new SchematicTestRunner(
1414
'@angular/pwa',
15-
path.join(__dirname, '../collection.json'),
15+
require.resolve(path.join(__dirname, '../collection.json')),
1616
);
1717
const defaultOptions: PwaOptions = {
1818
project: 'bar',

0 commit comments

Comments
 (0)