FixedArityExpressionT.js 943 B

12345678910111213141516171819202122232425262728293031323334353637
  1. "use strict";
  2. var assert = require("assert"),
  3. FixedArityExpressionT = require("../../../../lib/pipeline/expressions/FixedArityExpressionT");
  4. //TODO: refactor these test cases using Expression.parseOperand() or something because these could be a whole lot cleaner...
  5. module.exports = {
  6. "FixedArityExpressionT": {
  7. "constructor()": {
  8. "should not throw Error when constructing without args": function testConstructor() {
  9. assert.doesNotThrow(function () {
  10. new FixedArityExpressionT({}, 1);
  11. });
  12. },
  13. },
  14. "#validateArguments": {
  15. "should not throw when number of args matches the template nArgs": function matches() {
  16. var klass = FixedArityExpressionT(String,1),
  17. instance = new klass();
  18. assert.doesNotThrow(function() {
  19. instance.validateArguments(["arg"]);
  20. });
  21. }
  22. }
  23. }
  24. };
  25. if (!module.parent)(new(require("mocha"))()).ui("exports").reporter("spec").addFile(__filename).run(process.exit);