📁 Changed TDrive root folder (#16)

📁 Changed TDrive root folder
This commit is contained in:
Montassar Ghanmy
2023-04-11 10:04:29 +01:00
committed by GitHub
parent 3b3f67af07
commit e0615fa867
10548 changed files with 48 additions and 48 deletions
@@ -0,0 +1,35 @@
import { describe, expect, it } from "@jest/globals";
import * as pickUtils from "../../src/utils/pick";
describe("The pick utils", () => {
describe("The pick function", () => {
it("should return an object wich contains only the defined properties", () => {
class TestClass {
keep: string;
me: string;
skip: string;
}
const keysToKeep = ["keep", "me"] as const;
const object = { keep: "foo", me: "bar", skip: "baz" } as TestClass;
const result = pickUtils.pick(object, ...keysToKeep);
expect(result).toEqual({ keep: "foo", me: "bar" });
expect(result).not.toContain("skip");
});
it("should return an empty object when input is empty", () => {
class TestClass {
keep: string;
me: string;
skip: string;
}
const keysToKeep = [] as const;
const object = { keep: "foo", me: "bar", skip: "baz" } as TestClass;
const result = pickUtils.pick(object, ...keysToKeep);
expect(result).toEqual({});
});
});
});