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 3.3.1 to 3.4.0

release_notes/3.4.0.md

4

bower.json
{
"name": "jasmine-ajax",
"description": "A library for faking Ajax responses in your Jasmine suite.",
"version": "3.3.1",
"version": "3.4.0",
"main": "lib/mock-ajax.js",

@@ -14,3 +14,3 @@ "license": "MIT",

"dependencies": {
"jasmine" : "~2"
"jasmine" : "~3"
},

@@ -17,0 +17,0 @@ "moduleType": [

@@ -300,3 +300,3 @@ /*

this.method = arguments[0];
this.url = arguments[1];
this.url = arguments[1] + '';
this.username = arguments[3];

@@ -313,3 +313,3 @@ this.password = arguments[4];

}
if(this.requestHeaders.hasOwnProperty(header)) {

@@ -371,3 +371,3 @@ this.requestHeaders[header] = [this.requestHeaders[header], value].join(', ');

} else if (stub.isError()) {
this.responseError();
this.responseError(stub);
} else if (stub.isTimeout()) {

@@ -464,2 +464,5 @@ this.responseTimeout();

}
if (response.responseJSON) {
this.responseText = JSON.stringify(response.responseJSON);
}

@@ -490,6 +493,11 @@ if ('response' in response) {

responseError: function() {
responseError: function(response) {
if (!response) {
response = {};
}
if (this.readyState === FakeXMLHttpRequest.DONE) {
throw new Error("FakeXMLHttpRequest already completed");
}
this.status = response.status;
this.statusText = response.statusText || "";
this.readyState = FakeXMLHttpRequest.DONE;

@@ -524,4 +532,4 @@ this.eventBus.trigger('readystatechange');

this.install = function() {
if (global.XMLHttpRequest === mockAjaxFunction) {
throw "MockAjax is already installed.";
if (global.XMLHttpRequest !== realAjaxFunction) {
throw new Error("Jasmine Ajax was unable to install over a custom XMLHttpRequest. Is Jasmine Ajax already installed?");
}

@@ -534,3 +542,3 @@

if (global.XMLHttpRequest !== mockAjaxFunction) {
throw "MockAjax not installed.";
throw new Error("MockAjax not installed.");
}

@@ -652,3 +660,4 @@ global.XMLHttpRequest = realAjaxFunction;

this.action = RETURN;
this.status = options.status || 200;
this.status = (typeof options.status !== 'undefined') ? options.status : 200;
this.statusText = options.statusText;

@@ -666,4 +675,8 @@ this.contentType = options.contentType;

this.andError = function() {
this.andError = function(options) {
if (!options) {
options = {};
}
this.action = ERROR;
this.status = options.status || 500;
};

@@ -670,0 +683,0 @@

{
"name": "jasmine-ajax",
"description": "A library for faking Ajax responses in your Jasmine suite",
"version": "3.3.1",
"version": "3.4.0",
"main": "lib/mock-ajax.js",

@@ -6,0 +6,0 @@ "license": "MIT",

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