2018-03-01 13:41:35 -05:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 15:08:49 -04:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2018-03-01 13:41:35 -05:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2020-01-08 04:30:07 -05:00
|
|
|
const path = require('path');
|
|
|
|
const runfiles = require(process.env['BAZEL_NODE_RUNFILES_HELPER']);
|
2018-10-29 16:25:00 -04:00
|
|
|
|
2020-01-08 04:30:07 -05:00
|
|
|
// 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
|
2018-10-29 16:25:00 -04:00
|
|
|
// 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.
|
2020-02-04 14:45:40 -05:00
|
|
|
// 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.
|
2018-10-29 16:25:00 -04:00
|
|
|
// TODO: remove the whole bootstrap file once the tests are Bazel and Windows compatible.
|
2020-02-04 14:45:40 -05:00
|
|
|
process.chdir(path.resolve(
|
|
|
|
runfiles.resolve('angular/tools/ts-api-guardian/test/fixtures/empty.ts'), '../../..'));
|