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:
parent
3635206de8
commit
b5ed6eb81e
@ -129,8 +129,18 @@ const tests: KubeApiParseTestData[] = [
|
||||
}],
|
||||
];
|
||||
|
||||
const throwtests = [
|
||||
undefined,
|
||||
"",
|
||||
"ajklsmh"
|
||||
];
|
||||
|
||||
describe("parseApi unit tests", () => {
|
||||
it.each(tests)("testing %s", (url, expected) => {
|
||||
it.each(tests)("testing %j", (url, expected) => {
|
||||
expect(parseKubeApi(url)).toStrictEqual(expected);
|
||||
});
|
||||
|
||||
it.each(throwtests)("testing %j should throw", (url) => {
|
||||
expect(() => parseKubeApi(url)).toThrowError("invalid apiPath");
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user