ensure internal streams have same constructor as public streams
This commit is contained in:
parent
678e4912c7
commit
f201ea73ff
7 changed files with 39 additions and 33 deletions
|
|
@ -3,8 +3,7 @@
|
|||
var buildQueryString = require("../querystring/build")
|
||||
var StreamFactory = require("../util/stream")
|
||||
|
||||
module.exports = function($window, log) {
|
||||
var Stream = StreamFactory(log)
|
||||
module.exports = function($window, Stream) {
|
||||
var callbackCount = 0
|
||||
|
||||
var oncompletion
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
var o = require("../../ospec/ospec")
|
||||
var xhrMock = require("../../test-utils/xhrMock")
|
||||
var Request = require("../../request/request")
|
||||
var StreamFactory = require("../../util/stream")
|
||||
var parseQueryString = require("../../querystring/parse")
|
||||
|
||||
o.spec("jsonp", function() {
|
||||
|
|
@ -10,7 +11,7 @@ o.spec("jsonp", function() {
|
|||
o.beforeEach(function() {
|
||||
mock = xhrMock()
|
||||
spy = o.spy()
|
||||
jsonp = new Request(mock, spy).jsonp
|
||||
jsonp = new Request(mock, StreamFactory(spy)).jsonp
|
||||
})
|
||||
|
||||
o("works", function(done) {
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@
|
|||
var o = require("../../ospec/ospec")
|
||||
var xhrMock = require("../../test-utils/xhrMock")
|
||||
var Request = require("../../request/request")
|
||||
var StreamFactory = require("../../util/stream")
|
||||
|
||||
o.spec("xhr", function() {
|
||||
var mock, xhr, spy
|
||||
o.beforeEach(function() {
|
||||
mock = xhrMock()
|
||||
spy = o.spy()
|
||||
xhr = new Request(mock, spy).request
|
||||
xhr = new Request(mock, StreamFactory(spy)).request
|
||||
})
|
||||
|
||||
o.spec("success", function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue