Paul Gschwendtner fd9a7ca8c9 build: update to latest version of rules_nodejs v3.3.0 (#41599)
Updates to the latest version of `rules_nodejs` that supports
the most recent NodeJS lts version v14.16.1.

Additionally the latest version of `rules_nodejs` provides
[a package for runfile resolution](https://github.com/bazelbuild/rules_nodejs/pull/2568) w/ types that we can leverage.

PR Close #41599
2021-04-13 17:37:28 -07:00

21 lines
1.0 KiB
TypeScript

/**
* @license
* Copyright Google LLC 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
*/
const path = require('path');
const {runfiles} = require('@bazel/runfiles');
// Change directories to the path of the ts-api-guardian source tree. We need to resolve an actual
// path of a tree because we want to determine the path to the directory that includes all
// test fixture runfiles. On Windows this is usually the original non-sandboxed disk location,
// otherwise this just refers to the runfile directory with all the proper symlinked files.
// NB: we resolve `test/fixtures/empty.ts` and then step up 3 folders so to ensure we resolve to the
// root of the source tree and not the output tree on Windows where there are no runfiles.
// TODO: remove the whole bootstrap file once the tests are Bazel and Windows compatible.
process.chdir(path.resolve(
runfiles.resolve('angular/tools/ts-api-guardian/test/fixtures/empty.ts'), '../../..'));