Remove tests of internal function now its behaviour has been verified
This commit is contained in:
parent
f8c87948ab
commit
7c00663f08
6 changed files with 3 additions and 25 deletions
1
lib/config-utils.js
generated
1
lib/config-utils.js
generated
|
|
@ -231,7 +231,6 @@ function isLocal(configPath) {
|
|||
}
|
||||
return (configPath.indexOf("@") === -1);
|
||||
}
|
||||
exports.isLocal = isLocal;
|
||||
function getLocalConfig(configFile, workspacePath) {
|
||||
// Error if the config file is now outside of the workspace
|
||||
if (!(configFile + path.sep).startsWith(workspacePath + path.sep)) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
9
lib/config-utils.test.js
generated
9
lib/config-utils.test.js
generated
|
|
@ -132,15 +132,6 @@ ava_1.default("load non-empty input", async (t) => {
|
|||
t.deepEqual(actualConfig, expectedConfig);
|
||||
});
|
||||
});
|
||||
ava_1.default("Remote and local configuration paths correctly identified", t => {
|
||||
// If the path starts with ./, look locally
|
||||
t.assert(configUtils.isLocal('./file'));
|
||||
t.assert(configUtils.isLocal('./file@name'));
|
||||
// Otherwise, if the path contains @ (branch specifier), assume it's a remote repo
|
||||
t.false(configUtils.isLocal('octo-org/codeql-config/config.yaml@main'));
|
||||
// Otherwise look locally (this is the fallback)
|
||||
t.assert(configUtils.isLocal('file'));
|
||||
});
|
||||
ava_1.default("API client used when reading remote config", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -145,18 +145,6 @@ test("load non-empty input", async t => {
|
|||
});
|
||||
});
|
||||
|
||||
test("Remote and local configuration paths correctly identified", t => {
|
||||
// If the path starts with ./, look locally
|
||||
t.assert(configUtils.isLocal('./file'));
|
||||
t.assert(configUtils.isLocal('./file@name'));
|
||||
|
||||
// Otherwise, if the path contains @ (branch specifier), assume it's a remote repo
|
||||
t.false(configUtils.isLocal('octo-org/codeql-config/config.yaml@main'));
|
||||
|
||||
// Otherwise look locally (this is the fallback)
|
||||
t.assert(configUtils.isLocal('file'));
|
||||
});
|
||||
|
||||
test("API client used when reading remote config", async t => {
|
||||
return await util.withTmpDir(async tmpDir => {
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ async function initConfig(): Promise<Config> {
|
|||
return config;
|
||||
}
|
||||
|
||||
export function isLocal(configPath: string): boolean {
|
||||
function isLocal(configPath: string): boolean {
|
||||
// If the path starts with ./, look locally
|
||||
if (configPath.indexOf("./") === 0) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue