8 lines
265 B
TypeScript
8 lines
265 B
TypeScript
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
|
|
import { attr } from "./objects.ts";
|
|
|
|
Deno.test("attr", () => {
|
|
const getx = attr("x");
|
|
assertEquals(getx({ x: 4, y: 5 }), 4);
|
|
assertEquals(getx({ x: undefined, y: 5 }), undefined);
|
|
});
|