Skip to content

Commit 18d549e

Browse files
authored
build: update linker integration test to work with APF v13 (#23883)
Updates the linker integration test, which is an additional test we run for the linker, besides running our tests with the linker. The linker integration test ensures that the NPM package partial compilation output can be processed properly, and ensures that there are no unprocessable partial declarations.
1 parent 2115193 commit 18d549e

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

integration/linker/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ nodejs_test(
1515
"//src/youtube-player:npm_package",
1616
"@npm//@angular/compiler-cli",
1717
"@npm//@babel/core",
18-
"@npm//@babel/traverse",
1918
"@npm//chalk",
2019
"@npm//glob",
2120
],

integration/linker/link-packages-test.mjs

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {getNpmPackagesFromRunfiles} from '../npm-packages-from-runfiles.mjs';
99
import fs from 'fs';
1010
import path from 'path';
1111
import babel from '@babel/core';
12-
import traverse from '@babel/traverse';
1312
import glob from 'glob';
1413
import chalk from 'chalk';
1514

@@ -57,7 +56,7 @@ if (failedPackages) {
5756
* @returns An object containing linker failures and passed files.
5857
*/
5958
function testPackage(pkg) {
60-
const entryPointFesmFiles = glob.sync(`fesm2015/**/*.js`, {cwd: pkg.pkgPath});
59+
const entryPointFesmFiles = glob.sync(`+(fesm2015|fesm2020)/**/*.mjs`, {cwd: pkg.pkgPath});
6160
const passedFiles = [];
6261
const failures = [];
6362

@@ -80,7 +79,7 @@ function testPackage(pkg) {
8079
});
8180

8281
// Naively check if there are any Angular declarations left that haven't been linked.
83-
traverse(ast, {
82+
babel.traverse(ast, {
8483
Identifier: astPath => {
8584
if (astPath.node.name.startsWith('ɵɵngDeclare')) {
8685
throw astPath.buildCodeFrameError(

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@
7878
"@angular/platform-server": "13.0.0-rc.3",
7979
"@angular/router": "13.0.0-rc.3",
8080
"@axe-core/webdriverjs": "^4.1.0",
81-
"@babel/core": "^7.13.10",
82-
"@babel/traverse": "^7.13.0",
81+
"@babel/core": "^7.16.0",
8382
"@bazel/bazelisk": "1.10.1",
8483
"@bazel/buildifier": "4.2.1",
8584
"@bazel/concatjs": "4.3.0",

yarn.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@
460460
semver "^5.4.1"
461461
source-map "^0.5.0"
462462

463-
"@babel/core@>=7.9.0", "@babel/core@^7.13.10", "@babel/core@^7.8.6":
463+
"@babel/core@>=7.9.0", "@babel/core@^7.8.6":
464464
version "7.14.8"
465465
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.8.tgz#20cdf7c84b5d86d83fac8710a8bc605a7ba3f010"
466466
integrity sha512-/AtaeEhT6ErpDhInbXmjHcUQXH0L0TEgscfcxk1qbOvLuKCa5aZT0SOOtDKFY96/CLROwbLSKyFor6idgNaU4Q==
@@ -481,7 +481,7 @@
481481
semver "^6.3.0"
482482
source-map "^0.5.0"
483483

484-
"@babel/core@^7.12.3":
484+
"@babel/core@^7.12.3", "@babel/core@^7.16.0":
485485
version "7.16.0"
486486
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4"
487487
integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ==

0 commit comments

Comments
 (0)