mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 01:38:07 +08:00
The current tests try to figure out the root directory and then glob for _test.ts files within there, but this breaks easily if the folder structure isn't exactly as expected. Instead we can set this via a flag in the test runner. This CL only updates the interaction tests, which use the new runner. e2e tests will be supported in time. Bug: chromium:1186163 Change-Id: I198b67bf0081ce7334c40d7d661fb8642c2d56d0 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2772045 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
19 lines
597 B
JavaScript
19 lines
597 B
JavaScript
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
function getTestRunnerConfig() {
|
|
try {
|
|
return JSON.parse(process.env.TEST_RUNNER_JSON_CONFIG);
|
|
} catch {
|
|
// Return an empty object so any lookups return undefined
|
|
return {};
|
|
}
|
|
}
|
|
function getTestRunnerConfigSetting(settingKey, fallbackValue) {
|
|
const config = getTestRunnerConfig();
|
|
return config[settingKey] === undefined ? fallbackValue : config[settingKey];
|
|
}
|
|
|
|
module.exports = {getTestRunnerConfigSetting};
|