prefix for annotations (#191)

This commit is contained in:
David Gamero
2022-06-08 11:39:09 -04:00
committed by GitHub
parent 06a06b13b9
commit 507f2d4fc7
2 changed files with 29 additions and 1 deletions
@@ -0,0 +1,18 @@
import { prefixObjectKeys } from "../utilities/workflowAnnotationUtils";
describe("WorkflowAnnotationUtils", () => {
describe("prefixObjectKeys", () => {
it("should prefix an object with a given prefix", () => {
const obj = {
foo: "bar",
baz: "qux",
};
const prefix = "prefix.";
const expected = {
"prefix.foo": "bar",
"prefix.baz": "qux",
};
expect(prefixObjectKeys(obj, prefix)).toEqual(expected);
});
});
});