mirror of
https://github.com/github/codeql-action.git
synced 2026-11-08 14:09:51 +00:00
Rename isSwiftCompatible
This commit is contained in:
@@ -12,18 +12,18 @@ import {
|
||||
} from "../testing-utils";
|
||||
import { withTmpDir } from "../util";
|
||||
|
||||
import { isSwiftCompatible } from "./swift";
|
||||
import { checkSwiftCompatibility } from "./swift";
|
||||
|
||||
import { BuiltInLanguage } from ".";
|
||||
|
||||
test("isSwiftCompatible doesn't throw for non-Swift languages", (t) => {
|
||||
test("checkSwiftCompatibility doesn't throw for non-Swift languages", (t) => {
|
||||
for (const language of Object.values(BuiltInLanguage)) {
|
||||
if (language === BuiltInLanguage.swift) {
|
||||
continue;
|
||||
}
|
||||
|
||||
t.notThrows(() =>
|
||||
isSwiftCompatible(
|
||||
checkSwiftCompatibility(
|
||||
initAllState(),
|
||||
createTestConfig({ languages: [language] }),
|
||||
),
|
||||
@@ -31,7 +31,7 @@ test("isSwiftCompatible doesn't throw for non-Swift languages", (t) => {
|
||||
}
|
||||
});
|
||||
|
||||
test("isSwiftCompatible doesn't throw for Swift on darwin", async (t) =>
|
||||
test("checkSwiftCompatibility doesn't throw for Swift on darwin", async (t) =>
|
||||
withTmpDir(async (tmpDir) => {
|
||||
const logger = new RecordingLogger();
|
||||
const env = getTestEnv();
|
||||
@@ -41,7 +41,7 @@ test("isSwiftCompatible doesn't throw for Swift on darwin", async (t) =>
|
||||
sinon.stub(codeql, "getVersion").resolves(makeVersionInfo("2.27.0"));
|
||||
|
||||
t.notThrows(() =>
|
||||
isSwiftCompatible(
|
||||
checkSwiftCompatibility(
|
||||
initAllState({ platform: "darwin", env, logger }),
|
||||
createTestConfig({
|
||||
tempDir: tmpDir,
|
||||
@@ -53,9 +53,9 @@ test("isSwiftCompatible doesn't throw for Swift on darwin", async (t) =>
|
||||
|
||||
const nonDarwinPlatforms: NodeJS.Platform[] = ["linux", "win32"];
|
||||
for (const nonDarwinPlatform of nonDarwinPlatforms) {
|
||||
test(`isSwiftCompatible throws for Swift on ${nonDarwinPlatform}`, (t) => {
|
||||
test(`checkSwiftCompatibility throws for Swift on ${nonDarwinPlatform}`, (t) => {
|
||||
t.throws(() => {
|
||||
isSwiftCompatible(
|
||||
checkSwiftCompatibility(
|
||||
initAllState({ platform: nonDarwinPlatform }),
|
||||
createTestConfig({ languages: [BuiltInLanguage.swift] }),
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { BuiltInLanguage } from ".";
|
||||
* @throws {ConfigurationError} If Swift analysis is not possible on the current runner.
|
||||
* @returns True if we can run a Swift analysis.
|
||||
*/
|
||||
export function isSwiftCompatible(
|
||||
export function checkSwiftCompatibility(
|
||||
action: ActionState<["Base"]>,
|
||||
config: Config,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user