New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

can-fixture

Package Overview
Dependencies
Maintainers
5
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-fixture - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

2

package.json
{
"name": "can-fixture",
"version": "0.3.1",
"version": "0.3.2",
"description": "Intercept AJAX requests and simulate responses.",

@@ -5,0 +5,0 @@ "main": "fixture.js",

@@ -1350,1 +1350,26 @@ var Qunit = require('steal-qunit');

});
asyncTest('responseText & responseXML should not be set for arraybuffer types (#38)', function() {
fixture('/onload', '/test/fixtures/foo.json');
var oldError = window.onerror;
window.onerror = function (msg, url, line) {
ok(false, 'There should not be an error');
start();
}
var xhr = new XMLHttpRequest();
xhr.addEventListener('load', function() {
fixture('/onload', null);
window.onerror = oldError;
ok(true, 'Got here without an error');
start();
});
xhr.responseType = 'arraybuffer';
xhr.open('GET', '/onload');
xhr.send();
});

@@ -67,2 +67,11 @@ // This overwrites the default XHR with a mock XHR object.

xhr.onreadystatechange = function(ev){
// If the XHRs responseType is not '' or 'text', browsers will throw an error
// when trying to access the `responseText` property so we have to ignore it
if(xhr.responseType === '' || xhr.responseType === 'text') {
delete propsToIgnore.responseText;
delete propsToIgnore.responseXML;
} else {
propsToIgnore.responseText = true;
propsToIgnore.responseXML = true;
}

@@ -72,3 +81,4 @@ // Copy back everything over because in IE8 defineProperty

// values as the real xhr.
assign(mockXHR, xhr,propsToIgnore);
assign(mockXHR, xhr, propsToIgnore);
if(mockXHR.onreadystatechange) {

@@ -75,0 +85,0 @@ mockXHR.onreadystatechange(ev);

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