LetExpression_test.js 829 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. var assert = require("assert"),
  3. LetExpression = require("../../../../lib/pipeline/expressions/LetExpression"),
  4. Expression = require("../../../../lib/pipeline/expressions/Expression");
  5. module.exports = {
  6. "LetExpression": {
  7. "constructor()": {
  8. "should throw an Error when constructing without args": function () {
  9. assert.throws(function () {
  10. new LetExpression();
  11. });
  12. },
  13. "should throw Error when constructing with one arg": function () {
  14. assert.throws(function () {
  15. new LetExpression(1);
  16. });
  17. },
  18. "should not throw when constructing with two args": function () {
  19. assert.doesNotThrow(function () {
  20. new LetExpression(1, 2);
  21. });
  22. }
  23. }
  24. }
  25. };
  26. if (!module.parent)(new(require("mocha"))()).ui("exports").reporter("spec").addFile(__filename).run(process.exit);