1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Add some unit tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-07-13 09:22:55 -04:00
parent 3635206de8
commit b5ed6eb81e

View File

@ -129,8 +129,18 @@ const tests: KubeApiParseTestData[] = [
}], }],
]; ];
const throwtests = [
undefined,
"",
"ajklsmh"
];
describe("parseApi unit tests", () => { describe("parseApi unit tests", () => {
it.each(tests)("testing %s", (url, expected) => { it.each(tests)("testing %j", (url, expected) => {
expect(parseKubeApi(url)).toStrictEqual(expected); expect(parseKubeApi(url)).toStrictEqual(expected);
}); });
it.each(throwtests)("testing %j should throw", (url) => {
expect(() => parseKubeApi(url)).toThrowError("invalid apiPath");
});
}); });