test-redirects

Write automated tests for your redirects.

Usage no npm install needed!

<script type="module">
  import testRedirects from 'https://cdn.skypack.dev/test-redirects';
</script>

README

test-redirects

Write automated tests for your redirects.

Screenshot

npm styled with prettier Build Status Code Climate Dependency Status

Testing that your web server is configured correctly can be a pain. You want to make sure your users will always get to the correct location but manually testing this is slow, tedious and error-prone.

Installation

npm install -g test-redirects

Usage

test-redirects

The script will look for a file called test-redirects.json. This file should contain an object where the keys are the origin url and values are the expected destination after being redirected.

{
  "http://npmjs.com": "https://www.npmjs.com/",
  "http://www.npmjs.com": "https://www.npmjs.com/",
  "https://npmjs.com": "https://www.npmjs.com/",
  "https://www.npmjs.com": "https://www.npmjs.com/",
  "https://www.npmjs.com/": "https://www.npmjs.com/"
}

Related

License

MIT © Wayne Ashley Berry