custom.js 594 B

1234567891011121314151617181920
  1. // Verify that custom promises work as advertised.
  2. var PrPromise = require('prfun');
  3. var assert = require('../assert');
  4. var fs = require('../fs');
  5. describe('Verify that custom promises can be used', function() {
  6. var oldPromise;
  7. before(function() {
  8. oldPromise = require('../_promise')();
  9. require('../_promise')(PrPromise);
  10. });
  11. after(function() {
  12. require('../_promise')(oldPromise);
  13. });
  14. it('exists should use the custom promise type', function() {
  15. var p = fs.exists('abc');
  16. assert.equal(p instanceof PrPromise, true);
  17. });
  18. });