mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
Fixing issue #3
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
var defaults = require('../../lib/defaults');
|
||||
|
||||
module.exports = {
|
||||
testTransformRequestJson: function (test) {
|
||||
var data = defaults.transformRequest[0]({foo: 'bar'});
|
||||
|
||||
test.equals(data, '{"foo":"bar"}');
|
||||
test.done();
|
||||
},
|
||||
|
||||
testTransformRequestString: function (test) {
|
||||
var data = defaults.transformRequest[0]('foo=bar');
|
||||
|
||||
test.equals(data, 'foo=bar');
|
||||
test.done();
|
||||
},
|
||||
|
||||
testTransformResponseJson: function (test) {
|
||||
var data = defaults.transformResponse[0]('{"foo":"bar"}');
|
||||
|
||||
test.equals(typeof data, 'object');
|
||||
test.equals(data.foo, 'bar');
|
||||
test.done();
|
||||
},
|
||||
|
||||
testTransformResponseString: function (test) {
|
||||
var data = defaults.transformResponse[0]('foo=bar');
|
||||
|
||||
test.equals(data, 'foo=bar');
|
||||
test.done();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user