Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxfierke/ember-service-worker-request-chaos
Like Netflix's ChaosMonkey but for your Ember SPA's API requests
https://github.com/maxfierke/ember-service-worker-request-chaos
Last synced: 3 months ago
JSON representation
Like Netflix's ChaosMonkey but for your Ember SPA's API requests
- Host: GitHub
- URL: https://github.com/maxfierke/ember-service-worker-request-chaos
- Owner: maxfierke
- License: mit
- Archived: true
- Created: 2017-10-29T19:43:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T17:36:50.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T18:01:04.960Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 344 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-ember - ember-service-worker-request-chaos - Like Netflix's Chaos Monkey but for your Ember.js SPA's API requests. (Packages / Service Workers)
README
# 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
* [`ember-service-worker`](https://github.com/DockYard/ember-service-worker)
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 ` 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