_tests.js 486 B

123456789101112131415
  1. "use strict";
  2. var assert = require("chai").assert;
  3. module.exports = function (entries) {
  4. it("Should resolve entries array for an object", function () {
  5. assert.deepEqual(entries({ foo: "bar" }), [["foo", "bar"]]);
  6. });
  7. it("Should resolve entries array for a primitive", function () {
  8. assert.deepEqual(entries("raz"), [["0", "r"], ["1", "a"], ["2", "z"]]);
  9. });
  10. it("Should throw on non-value", function () {
  11. assert["throws"](function () { entries(null); }, TypeError);
  12. });
  13. };