Prettier backfill

This commit is contained in:
Matt Rubens
2025-01-17 14:11:28 -05:00
parent 3bcb4ff8c5
commit 60a0a824b9
174 changed files with 15715 additions and 15428 deletions

View File

@@ -1,57 +1,57 @@
import { checkExistKey } from '../checkExistApiConfig';
import { ApiConfiguration } from '../api';
import { checkExistKey } from "../checkExistApiConfig"
import { ApiConfiguration } from "../api"
describe('checkExistKey', () => {
it('should return false for undefined config', () => {
expect(checkExistKey(undefined)).toBe(false);
});
describe("checkExistKey", () => {
it("should return false for undefined config", () => {
expect(checkExistKey(undefined)).toBe(false)
})
it('should return false for empty config', () => {
const config: ApiConfiguration = {};
expect(checkExistKey(config)).toBe(false);
});
it("should return false for empty config", () => {
const config: ApiConfiguration = {}
expect(checkExistKey(config)).toBe(false)
})
it('should return true when one key is defined', () => {
const config: ApiConfiguration = {
apiKey: 'test-key'
};
expect(checkExistKey(config)).toBe(true);
});
it("should return true when one key is defined", () => {
const config: ApiConfiguration = {
apiKey: "test-key",
}
expect(checkExistKey(config)).toBe(true)
})
it('should return true when multiple keys are defined', () => {
const config: ApiConfiguration = {
apiKey: 'test-key',
glamaApiKey: 'glama-key',
openRouterApiKey: 'openrouter-key'
};
expect(checkExistKey(config)).toBe(true);
});
it("should return true when multiple keys are defined", () => {
const config: ApiConfiguration = {
apiKey: "test-key",
glamaApiKey: "glama-key",
openRouterApiKey: "openrouter-key",
}
expect(checkExistKey(config)).toBe(true)
})
it('should return true when only non-key fields are undefined', () => {
const config: ApiConfiguration = {
apiKey: 'test-key',
apiProvider: undefined,
anthropicBaseUrl: undefined
};
expect(checkExistKey(config)).toBe(true);
});
it("should return true when only non-key fields are undefined", () => {
const config: ApiConfiguration = {
apiKey: "test-key",
apiProvider: undefined,
anthropicBaseUrl: undefined,
}
expect(checkExistKey(config)).toBe(true)
})
it('should return false when all key fields are undefined', () => {
const config: ApiConfiguration = {
apiKey: undefined,
glamaApiKey: undefined,
openRouterApiKey: undefined,
awsRegion: undefined,
vertexProjectId: undefined,
openAiApiKey: undefined,
ollamaModelId: undefined,
lmStudioModelId: undefined,
geminiApiKey: undefined,
openAiNativeApiKey: undefined,
deepSeekApiKey: undefined,
mistralApiKey: undefined,
vsCodeLmModelSelector: undefined
};
expect(checkExistKey(config)).toBe(false);
});
});
it("should return false when all key fields are undefined", () => {
const config: ApiConfiguration = {
apiKey: undefined,
glamaApiKey: undefined,
openRouterApiKey: undefined,
awsRegion: undefined,
vertexProjectId: undefined,
openAiApiKey: undefined,
ollamaModelId: undefined,
lmStudioModelId: undefined,
geminiApiKey: undefined,
openAiNativeApiKey: undefined,
deepSeekApiKey: undefined,
mistralApiKey: undefined,
vsCodeLmModelSelector: undefined,
}
expect(checkExistKey(config)).toBe(false)
})
})

View File

@@ -1,44 +1,44 @@
import { stringifyVsCodeLmModelSelector, SELECTOR_SEPARATOR } from '../vsCodeSelectorUtils';
import { LanguageModelChatSelector } from 'vscode';
import { stringifyVsCodeLmModelSelector, SELECTOR_SEPARATOR } from "../vsCodeSelectorUtils"
import { LanguageModelChatSelector } from "vscode"
describe('vsCodeSelectorUtils', () => {
describe('stringifyVsCodeLmModelSelector', () => {
it('should join all defined selector properties with separator', () => {
describe("vsCodeSelectorUtils", () => {
describe("stringifyVsCodeLmModelSelector", () => {
it("should join all defined selector properties with separator", () => {
const selector: LanguageModelChatSelector = {
vendor: 'test-vendor',
family: 'test-family',
version: 'v1',
id: 'test-id'
};
vendor: "test-vendor",
family: "test-family",
version: "v1",
id: "test-id",
}
const result = stringifyVsCodeLmModelSelector(selector);
expect(result).toBe('test-vendor/test-family/v1/test-id');
});
const result = stringifyVsCodeLmModelSelector(selector)
expect(result).toBe("test-vendor/test-family/v1/test-id")
})
it('should skip undefined properties', () => {
it("should skip undefined properties", () => {
const selector: LanguageModelChatSelector = {
vendor: 'test-vendor',
family: 'test-family'
};
vendor: "test-vendor",
family: "test-family",
}
const result = stringifyVsCodeLmModelSelector(selector);
expect(result).toBe('test-vendor/test-family');
});
const result = stringifyVsCodeLmModelSelector(selector)
expect(result).toBe("test-vendor/test-family")
})
it('should handle empty selector', () => {
const selector: LanguageModelChatSelector = {};
it("should handle empty selector", () => {
const selector: LanguageModelChatSelector = {}
const result = stringifyVsCodeLmModelSelector(selector);
expect(result).toBe('');
});
const result = stringifyVsCodeLmModelSelector(selector)
expect(result).toBe("")
})
it('should handle selector with only one property', () => {
it("should handle selector with only one property", () => {
const selector: LanguageModelChatSelector = {
vendor: 'test-vendor'
};
vendor: "test-vendor",
}
const result = stringifyVsCodeLmModelSelector(selector);
expect(result).toBe('test-vendor');
});
});
});
const result = stringifyVsCodeLmModelSelector(selector)
expect(result).toBe("test-vendor")
})
})
})