All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.cldrjs.test.unit.resource.get.js Maven / Gradle / Ivy

The newest version!
define([
    "src/resource/get",
], function (resourceGet) {

    var data = {a: {b: {c: 5}}};

    describe("Data Get", function () {

        it("should return existing data value", function () {
            expect(resourceGet(data, ["a", "b", "c"])).to.equal(5);
        });

        it("should return undefined for non-existing data", function () {
            expect(resourceGet(data, ["a", "b", "x"])).to.be.undefined;
        });

        it("should return undefined for non-existing tree", function () {
            expect(resourceGet(data, ["x", "y", "z"])).to.be.undefined;
        });

    });

});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy