functional/objects.test.ts

9 lines
232 B
TypeScript
Raw Normal View History

2020-05-13 09:46:10 +00:00
import { expect, test } from "./deps.test.ts";
2020-05-11 22:34:57 +00:00
import { attr } from "./objects.ts";
2020-05-13 09:46:10 +00:00
test("attr", () => {
2020-05-11 22:34:57 +00:00
const getx = attr("x");
2020-05-13 09:46:10 +00:00
expect(getx({ x: 4, y: 5 })).toBe(4);
expect(getx({ x: undefined, y: 5 })).toBeUndefined();
2020-05-11 22:34:57 +00:00
});