Socket
Book a DemoInstallSign in
Socket

ember-service-worker-request-chaos

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-service-worker-request-chaos

A service worker that wrecks chaos on your API requests.

0.1.4
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ember-service-worker-request-chaos

Often our applications talk to external APIs. Sometimes our apps talk to external APIs that suck are unreliable. Often, we don't test the failure cases well enough (or at all).

  • What does it look like when a request to X service flakes out?
  • Where could we add recovery options?

We can answer these questions with Service Workers and not have to spend time setting up a proxy on our local machines to MITM all of our traffic. This addon adds a service worker via ember-service-worker to intercept specified requests and will randomly return error responses in the 5xx range.

Find out how well your application tolerates failure!

Runtime dependencies

Installation

  • ember install ember-service-worker - (If you're not already using it)

  • ember install ember-service-worker-request-chaos

  • Define some patterns to intercept in your ember-cli-build.js

    /* eslint-env node */
    'use strict';
    
    const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
    
    module.exports = function(defaults) {
      let app = new EmberApp(defaults, {
        'esw-request-chaos': {
          // RegExp patterns specifying which URLs to wreck chaos.
          patterns: [
            'https://scaling.is.difficult/api/(.+)',
          ]
        }
      });
    
      // [...]
    };
    
    

Installation for development

  • git clone <repository-url> this repository
  • cd ember-service-worker-request-chaos
  • yarn install

Running Tests

  • yarn test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

TODO

  • Configure to only include in development environment

Keywords

ember-addon

FAQs

Package last updated on 04 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.