UNPKG

siegel

Version:

Web application development ecosystem

1 lines 463 B
import"../../../global.d.ts";import e from"./index.js";describe("common/deep/get",()=>{test("get",()=>{expect(e({a:{b:{a:{val:"val"}}}},["a","b","a","val"])).toBe("val")}),test("get not exists",()=>{expect(e({a:{}},["a","b"])).toBeUndefined()}),test("get undefined",()=>{expect(e({a:null},["a"])).toBeUndefined(),expect(e({a:void 0},["a"])).toBeUndefined()}),test("get not exists fallback",()=>{expect(e({a:{}},["a","b"],"__FALLBACK__")).toBe("__FALLBACK__")})});