项目原始demo,不改动
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
Questo repository è archiviato. Puoi vedere i file e clonarli, ma non puoi effettuare richieste di pushj o aprire problemi/richieste di pull.
 
 
 
 

28 righe
909 B

  1. 'use strict';
  2. var assert = require('assert');
  3. var stream = require('stream');
  4. var hash = require('../index');
  5. describe('writeToStream', function() {
  6. it('should emit information about an object to a stream', function() {
  7. var strm = new stream.PassThrough();
  8. hash.writeToStream({foo: 'bar'}, strm);
  9. var result = strm.read().toString();
  10. assert.strictEqual(typeof result, 'string');
  11. assert.notStrictEqual(result.indexOf('foo'), -1);
  12. assert.notStrictEqual(result.indexOf('bar'), -1);
  13. });
  14. it('should leave out keys when excludeValues = true', function() {
  15. var strm = new stream.PassThrough();
  16. hash.writeToStream({foo: 'bar'}, {excludeValues: true}, strm);
  17. var result = strm.read().toString();
  18. assert.strictEqual(typeof result, 'string');
  19. assert.notStrictEqual(result.indexOf('foo'), -1);
  20. assert. strictEqual(result.indexOf('bar'), -1);
  21. });
  22. });