Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jasmine-ajax

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-ajax - npm Package Compare versions

Comparing version 2.99.0 to 3.0.0

release_notes/3.0.md

17

bower.json
{
"name": "jasmine-ajax",
"version": "2.0.1",
"homepage": "https://github.com/pivotal/jasmine-ajax",
"description": "A library for faking Ajax responses in your Jasmine suite.",
"version": "3.0.0",
"main": "lib/mock-ajax.js",
"license": "MIT",
"homepage": "https://github.com/jasmine/jasmine-ajax",
"authors": [

@@ -9,4 +13,2 @@ "JR Boyens <jboyens@fooninja.org>",

],
"description": "A library for faking Ajax responses in your Jasmine suite.",
"main": "lib/mock-ajax.js",
"dependencies": {

@@ -22,3 +24,2 @@ "jasmine" : "~2.0"

],
"license": "MIT",
"ignore": [

@@ -28,12 +29,10 @@ "**/.*",

"Gemfile.lock",
"Gruntfile",
"Gruntfile.js",
"Rakefile",
"app/bower_components",
"bower_components",
"node_modules",
"spec",
"test",
"tests",
"src",
"travis-script.sh"
]
}

@@ -86,2 +86,12 @@ /*

function unconvertibleResponseTypeMessage(type) {
var msg = [
"Can't build XHR.response for XHR.responseType of '",
type,
"'.",
"XHR.response must be explicitly stubbed"
];
return msg.join(' ');
}
function fakeRequest(global, requestTracker, stubTracker, paramParser) {

@@ -251,14 +261,27 @@ function FakeXMLHttpRequest() {

}
return responseHeaders.join('\r\n');
return responseHeaders.join('\r\n') + '\r\n';
},
responseText: null,
response: null,
responseType: null,
response: function(response) {
if (window.console && window.console.warn) {
window.console.warn("jasmine-ajax's response method is deprecated because it conflicts with XmlHTTPRequest 2 sytax. It will be removed in a later version. Please use respondWith");
responseValue: function() {
switch(this.responseType) {
case null:
case "":
case "text":
return this.readyState >= 3 ? this.responseText : "";
case "json":
return JSON.parse(this.responseText);
case "arraybuffer":
throw unconvertibleResponseTypeMessage('arraybuffer');
case "blob":
throw unconvertibleResponseTypeMessage('blob');
case "document":
return this.responseXML;
}
this.respondWith(response);
},
respondWith: function(response) {

@@ -271,6 +294,16 @@ if (this.readyState === 4) {

this.responseText = response.responseText || "";
this.responseType = response.responseType || "";
this.readyState = 4;
this.responseHeaders = normalizeHeaders(response.responseHeaders, response.contentType);
this.responseXML = getResponseXml(response.responseText, this.getResponseHeader('content-type') || '');
if (this.responseXML) {
this.responseType = 'document';
}
if ('response' in response) {
this.response = response.response;
} else {
this.response = this.responseValue();
}
this.onreadystatechange();

@@ -437,2 +470,3 @@ this.events.progress();

this.contentType = options.contentType;
this.response = options.response;
this.responseText = options.responseText;

@@ -439,0 +473,0 @@ };

{
"name": "jasmine-ajax",
"description": "A library for faking Ajax responses in your Jasmine suite",
"url": "https://github.com/pivotal/jasmine-ajax",
"version": "3.0.0",
"main": "lib/mock-ajax.js",
"version": "2.99.0",
"license": "MIT",
"url": "https://github.com/jasmine/jasmine-ajax",
"contributors": [
"Gregg Van Hove <gregg@slackersoft.net>",
"JR Boyens <jboyens@fooninja.org>"
],
"private": false,
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/pivotal/jasmine-ajax"
"url": "https://github.com/jasmine/jasmine-ajax"
},

@@ -13,0 +18,0 @@ "dependencies": {},

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc