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

@lion/ajax

Package Overview
Dependencies
Maintainers
3
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lion/ajax - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

2

package.json
{
"name": "@lion/ajax",
"version": "1.2.1",
"version": "1.2.2",
"description": "Thin wrapper around fetch with support for interceptors.",

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

@@ -8,3 +8,6 @@ export class AjaxFetchError extends Error {

constructor(request, response, body) {
super(`Fetch request to ${request.url} failed.`);
super(
`Fetch request to ${request.url} failed with status ${response.status} ${response.statusText}`,
);
this.name = 'AjaxFetchError';
this.request = request;

@@ -11,0 +14,0 @@ this.response = response;

@@ -582,2 +582,22 @@ import { expect } from '@open-wc/testing';

});
describe('AjaxFetchError', () => {
it('has the name AjaxFetchError', () => {
const error = new AjaxFetchError(new Request('/foobar'), new Response('foobar'), 'foobar');
expect(error.name).to.be.equal('AjaxFetchError');
});
it("displays the request failure text in it's message", () => {
const error = new AjaxFetchError(
new Request('/foobar'),
new Response('foobar', { status: 418, statusText: "I'm a teapot" }),
'foobar',
);
expect(error.message).to.include('http://localhost:8000/foobar');
expect(error.message).to.include('418');
expect(error.message).to.include("I'm a teapot");
});
});
});

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