Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run specs with buster instead of the dead project 'jasmine-runner'
- Loading branch information
Showing
5 changed files
with
58 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
var config = module.exports; | |||
|
|||
config["rpc"] = { | |||
environment: "browser", | |||
specs: ["spec/*.spec.js"], | |||
sources: ["strophe.rpc.js"], | |||
libs: [ | |||
"lib/strophe.js", | |||
"spec/strophe.rpc.spec.helper.js" | |||
] | |||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,39 +1,38 @@ | |||
var helper = (function() { | var helper = (function() { | ||
function receive(c,req) { | function receive(c,req) { | ||
c._dataRecv(createRequest(req)); | c._dataRecv(createRequest(req)); | ||
} | } | ||
|
|
||
function spyon (obj, method, cb) { | function spyon (obj, method, cb) { | ||
spyOn(obj,method).andCallFake(function(res) { | sinon.stub(obj,method, function(res) { | ||
res = res; | cb.call(this,res); | ||
cb.call(this,res); | }); | ||
}); | } | ||
} | |||
|
|
||
function mockConnection() { | function mockConnection() { | ||
var c = new Strophe.Connection(); | var c = new Strophe.Connection(); | ||
c.authenticated = true; | c.authenticated = true; | ||
c.jid = 'n@d/r2'; | c.jid = 'n@d/r2'; | ||
c._processRequest = function() {}; | c._processRequest = function() {}; | ||
c._changeConnectStatus(Strophe.Status.CONNECTED); | c._changeConnectStatus(Strophe.Status.CONNECTED); | ||
return c; | return c; | ||
} | } | ||
|
|
||
function createRequest(iq) { | function createRequest(iq) { | ||
iq = typeof iq.tree == "function" ? iq.tree() : iq; | iq = typeof iq.tree == "function" ? iq.tree() : iq; | ||
var req = new Strophe.Request(iq, function() {}); | var req = new Strophe.Request(iq, function() {}); | ||
req.getResponse = function() { | req.getResponse = function() { | ||
var env = new Strophe.Builder('env', {type: 'mock'}).tree(); | var env = new Strophe.Builder('env', {type: 'mock'}).tree(); | ||
env.appendChild(iq); | env.appendChild(iq); | ||
return env; | return env; | ||
}; | }; | ||
return req; | return req; | ||
} | } | ||
|
|
||
return { | return { | ||
createRequest: createRequest, | createRequest: createRequest, | ||
mockConnection: mockConnection, | mockConnection: mockConnection, | ||
receive: receive, | receive: receive, | ||
spyon: spyon | spyon: spyon | ||
}; | }; | ||
})(); | })(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters