VariadicExpressionT_test.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. "use strict";
  2. var assert = require("assert"),
  3. VariadicExpressionT = require("../../../../lib/pipeline/expressions/VariadicExpressionT"),
  4. NaryExpressionT = require("../../../../lib/pipeline/expressions/NaryExpressionT");
  5. //TODO: refactor these test cases using Expression.parseOperand() or something because these could be a whole lot cleaner...
  6. module.exports = {
  7. "VariadicExpression": {
  8. "constructor()": {
  9. "should not throw Error when constructing without args": function testConstructor() {
  10. assert.doesNotThrow(function () {
  11. new VariadicExpressionT({});
  12. });
  13. },
  14. "should be an instance of NaryExpression": function () {
  15. var VariadicExpressionString = VariadicExpressionT(String);
  16. assert.doesNotThrow(function() {
  17. var ves = new VariadicExpressionString();
  18. });
  19. var ves = new VariadicExpressionString();
  20. assert(ves.addOperand);
  21. assert(ves.validateArguments);
  22. //.... and so on. These prove we have a NaryExpression
  23. }
  24. }
  25. }
  26. };
  27. if (!module.parent)(new(require("mocha"))()).ui("exports").reporter("spec").addFile(__filename).run(process.exit);