DocumentSource.js 571 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. var assert = require("assert"),
  3. DocumentSource = require("../../../../lib/pipeline/documentSources/DocumentSource");
  4. module.exports = {
  5. "DocumentSource": {
  6. "depsToProjection": {
  7. "should be able to convert dependencies to a projection": function(){
  8. var array = {'a':1,'b':1},
  9. expected = '{"_id":0,"a":1,"b":1}',
  10. proj = DocumentSource.depsToProjection(array);
  11. assert.equal(expected, JSON.stringify(proj));
  12. },
  13. }
  14. }
  15. };
  16. if (!module.parent)(new(require("mocha"))()).ui("exports").reporter("spec").addFile(__filename).run();