mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-02 14:12:19 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
31
web/node_modules/duplexer/test/index.js
generated
vendored
Normal file
31
web/node_modules/duplexer/test/index.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
var through = require("through")
|
||||
var test = require("tape")
|
||||
|
||||
var duplex = require("../index")
|
||||
|
||||
var readable = through()
|
||||
var writable = through(write)
|
||||
var written = 0
|
||||
var data = 0
|
||||
|
||||
var stream = duplex(writable, readable)
|
||||
|
||||
function write() {
|
||||
written++
|
||||
}
|
||||
|
||||
stream.on("data", ondata)
|
||||
|
||||
function ondata() {
|
||||
data++
|
||||
}
|
||||
|
||||
test("emit and write", function(t) {
|
||||
t.plan(2)
|
||||
|
||||
stream.write()
|
||||
readable.emit("data")
|
||||
|
||||
t.equal(written, 1, "should have written once")
|
||||
t.equal(data, 1, "should have received once")
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue