MapExpression_test.js 895 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. var assert = require("assert"),
  3. MapExpression = require("../../../../lib/pipeline/expressions/MapExpression"),
  4. Expression = require("../../../../lib/pipeline/expressions/Expression");
  5. // Mocha one-liner to make these tests self-hosted
  6. if (!module.parent)return(require.cache[__filename] = null, (new (require("mocha"))({ui: "exports", reporter: "spec", grep: process.env.TEST_GREP})).addFile(__filename).run(process.exit));
  7. module.exports = {
  8. "MapExpression": {
  9. "constructor()": {
  10. "should accept 4 arguments": function () {
  11. new MapExpression(1, 2, 3, 4);
  12. },
  13. "should not accept less than 4 arguments": function () {
  14. assert.throws(function () {new MapExpression()});
  15. assert.throws(function () {new MapExpression(1)});
  16. assert.throws(function () {new MapExpression(1, 2)});
  17. assert.throws(function () {new MapExpression(1, 2, 3)});
  18. }
  19. }
  20. }
  21. }