Files
react-native-devtools-frontend/scripts/test/test_config_helpers.js
T
Jack Franklin a3dd06a3de Add test-suite-source-dir flag to new test runner
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>
2021-03-18 11:19:17 +00:00

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};