commit
This commit is contained in:
parent
70e2f7a8aa
commit
008d2f30d7
675 changed files with 189892 additions and 0 deletions
37
node_modules/xhr-send/test.js
generated
vendored
Normal file
37
node_modules/xhr-send/test.js
generated
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
describe('xhr-send', function () {
|
||||
'use strict';
|
||||
|
||||
var send = require('./')
|
||||
, assume = require('assume');
|
||||
|
||||
it('is exported as function', function () {
|
||||
assume(send).is.a('function');
|
||||
});
|
||||
|
||||
it('calls the supplied callback with an error', function (next) {
|
||||
send(undefined, '', function (err) {
|
||||
assume(err).is.instanceOf(Error);
|
||||
next();
|
||||
});
|
||||
});
|
||||
|
||||
it('returns false when it fails', function () {
|
||||
assume(send(undefined, '', function (err) {
|
||||
assume(err).is.instanceOf(Error);
|
||||
})).is.false();
|
||||
});
|
||||
|
||||
it('calls xhr open with the supplied data', function (next) {
|
||||
next = assume.plan(2, next);
|
||||
var stub = {
|
||||
send: function (data) {
|
||||
assume(data).equals('foo');
|
||||
}
|
||||
};
|
||||
|
||||
send(stub, 'foo', function (err) {
|
||||
assume(err).is.undefined();
|
||||
next();
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue