Skip to content

Commit 9e395dc

Browse files
committed
test(material/schematics): verify golden builds and doesn't contain 'legacy'
1 parent 4c79a90 commit 9e395dc

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

integration/mdc-migration/BUILD.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ migration_test(
4040
"sample-project/**/*",
4141
]),
4242
approve = False,
43+
verify = [
44+
"! grep" +
45+
" --include=*.{ts,css,scss,html}" +
46+
" --exclude-dir={node_modules,.angular,.yarn_cache_folder}" +
47+
" -ir legacy" +
48+
" || { echo \"Error: golden project contains 'legacy'.\" >&2; exit 1; }",
49+
"yarn build",
50+
# TODO(mmalerba): add back once slider tests pass.
51+
# "yarn test",
52+
],
4353
)
4454

4555
migration_test(

integration/mdc-migration/golden/angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{
3737
"type": "initial",
3838
"maximumWarning": "500kb",
39-
"maximumError": "1mb"
39+
"maximumError": "2mb"
4040
},
4141
{
4242
"type": "anyComponentStyle",

integration/mdc-migration/migration-test.bzl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ IGNORED_FILES = [
2121
"yarn.lock",
2222
]
2323

24-
def migration_test(name, srcs, approve):
24+
def migration_test(name, srcs, approve, verify = []):
2525
node_integration_test(
2626
name = name,
2727
srcs = srcs,
@@ -32,15 +32,13 @@ def migration_test(name, srcs, approve):
3232
# TODO(devversion): determine if a solution/workaround could live in the test runner.
3333
"yarn install --cache-folder .yarn_cache_folder/",
3434
"yarn ng generate @angular/material:mdc-migration --components all",
35-
# TODO(amysorto): add back once MDC components are in @angular/material
36-
# "yarn test",
3735
" ".join([
3836
"$(rootpath :verify_golden)",
3937
"%s" % approve,
4038
"../golden",
4139
"integration/mdc-migration/golden",
4240
] + IGNORED_FILES),
43-
],
41+
] + verify,
4442
data = [
4543
":golden_project",
4644
":test_project",

integration/mdc-migration/sample-project/angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{
3737
"type": "initial",
3838
"maximumWarning": "500kb",
39-
"maximumError": "1mb"
39+
"maximumError": "2mb"
4040
},
4141
{
4242
"type": "anyComponentStyle",

0 commit comments

Comments
 (0)