Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Last active August 29, 2015 14:19
Show Gist options
  • Save ajcrites/47d06390bab8bbe6e7cb to your computer and use it in GitHub Desktop.
Save ajcrites/47d06390bab8bbe6e7cb to your computer and use it in GitHub Desktop.
/**
* Error Factory does not allow (or do anything about)
* duplicate error definitions
*/
var assert = require("assert");
var errorFactory = require("error-factory");
var one = errorFactory("One", {value: "one"});
var two = errorFactory("Two", {value: "two"});
var three = errorFactory("Three", {value: "three"});
var four = errorFactory("One", {value: "four"});
var five = errorFactory("Two", {value: "five"});
var six = errorFactory("Three", {value: "six"});
assert.equal(new four().value, "one");
assert.equal(new five().value, "two");
assert.equal(new six().value, "three");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment