New Upstream Snapshot - node-json-stringify-safe
Ready changes
Summary
Merged new upstream version: 5.0.1+repack+git20150520.2.5930d6e (was: 5.0.1+repack+git20150520.1.5930d6e).
Resulting package
Built on 2023-01-15T16:31 (took 6m48s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots node-json-stringify-safe
Diff
diff --git a/.npmignore b/.npmignore
deleted file mode 100644
index 17d6b36..0000000
--- a/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-/*.tgz
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 42bcb60..6727d73 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-## Unreleased
+## 5.0.1 (May 19, 2015)
- Fixes stringify to only take ancestors into account when checking
circularity.
It previously assumed every visited object was circular which led to [false
diff --git a/debian/changelog b/debian/changelog
index 7cdd836..b16f03e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+node-json-stringify-safe (5.0.1+repack+git20150520.2.5930d6e-1) UNRELEASED; urgency=low
+
+ * New upstream snapshot.
+ * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk> Sun, 15 Jan 2023 16:27:04 -0000
+
node-json-stringify-safe (5.0.1+repack-6) unstable; urgency=medium
[ Debian Janitor ]
diff --git a/debian/patches/fix-test.patch b/debian/patches/fix-test.patch
index 3b7ecd8..ced97a4 100644
--- a/debian/patches/fix-test.patch
+++ b/debian/patches/fix-test.patch
@@ -3,8 +3,10 @@ Author: Xavier Guimard <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2020-12-27
---- a/test/stringify_test.js
-+++ b/test/stringify_test.js
+Index: node-json-stringify-safe.git/test/stringify_test.js
+===================================================================
+--- node-json-stringify-safe.git.orig/test/stringify_test.js
++++ node-json-stringify-safe.git/test/stringify_test.js
@@ -1,5 +1,6 @@
var Sinon = require("sinon")
var stringify = require("..")
@@ -12,7 +14,7 @@ Last-Update: 2020-12-27
function jsonify(obj) { return JSON.stringify(obj, null, 2) }
describe("Stringify", function() {
-@@ -7,43 +8,43 @@
+@@ -7,43 +8,43 @@ describe("Stringify", function() {
var obj = {name: "Alice"}
obj.self = obj
var json = stringify(obj, null, 2)
@@ -64,7 +66,7 @@ Last-Update: 2020-12-27
})
it("must stringify circular objects deeper in an array", function() {
-@@ -51,13 +52,13 @@
+@@ -51,13 +52,13 @@ describe("Stringify", function() {
obj.children[0].self = obj.children[0]
obj.children[1].self = obj.children[1]
@@ -80,7 +82,7 @@ Last-Update: 2020-12-27
})
it("must stringify circular arrays", function() {
-@@ -65,7 +66,7 @@
+@@ -65,7 +66,7 @@ describe("Stringify", function() {
obj.push(obj)
obj.push(obj)
var json = stringify(obj, null, 2)
@@ -89,7 +91,7 @@ Last-Update: 2020-12-27
})
it("must stringify circular arrays with intermediaries", function() {
-@@ -73,10 +74,10 @@
+@@ -73,10 +74,10 @@ describe("Stringify", function() {
obj.push({name: "Alice", self: obj})
obj.push({name: "Bob", self: obj})
@@ -102,7 +104,7 @@ Last-Update: 2020-12-27
})
it("must stringify repeated objects in objects", function() {
-@@ -85,17 +86,17 @@
+@@ -85,17 +86,17 @@ describe("Stringify", function() {
obj.alice1 = alice
obj.alice2 = alice
@@ -123,7 +125,7 @@ Last-Update: 2020-12-27
})
it("must call given decycler and use its output", function() {
-@@ -105,15 +106,15 @@
+@@ -105,15 +106,15 @@ describe("Stringify", function() {
var decycle = Sinon.spy(function() { return decycle.callCount })
var json = stringify(obj, null, 2, decycle)
@@ -147,7 +149,7 @@ Last-Update: 2020-12-27
})
it("must call replacer and use its output", function() {
-@@ -121,20 +122,20 @@
+@@ -121,20 +122,20 @@ describe("Stringify", function() {
var replacer = Sinon.spy(bangString)
var json = stringify(obj, replacer, 2)
@@ -181,7 +183,7 @@ Last-Update: 2020-12-27
})
it("must call replacer after describing circular references", function() {
-@@ -143,17 +144,17 @@
+@@ -143,17 +144,17 @@ describe("Stringify", function() {
var replacer = Sinon.spy(bangString)
var json = stringify(obj, replacer, 2)
@@ -209,7 +211,7 @@ Last-Update: 2020-12-27
})
it("must call given decycler and use its output for nested objects",
-@@ -164,13 +165,13 @@
+@@ -164,13 +165,13 @@ describe("Stringify", function() {
var decycle = Sinon.spy(function() { return decycle.callCount })
var json = stringify(obj, null, 2, decycle)
@@ -229,7 +231,7 @@ Last-Update: 2020-12-27
})
it("must use decycler's output when it returned null", function() {
-@@ -179,11 +180,11 @@
+@@ -179,11 +180,11 @@ describe("Stringify", function() {
obj.selves = [obj, obj]
function decycle() { return null }
@@ -243,7 +245,7 @@ Last-Update: 2020-12-27
})
it("must use decycler's output when it returned undefined", function() {
-@@ -192,10 +193,10 @@
+@@ -192,10 +193,10 @@ describe("Stringify", function() {
obj.selves = [obj, obj]
function decycle() {}
@@ -256,7 +258,7 @@ Last-Update: 2020-12-27
})
it("must throw given a decycler that returns a cycle", function() {
-@@ -204,7 +205,7 @@
+@@ -204,7 +205,7 @@ describe("Stringify", function() {
var err
function identity(key, value) { return value }
try { stringify(obj, null, 2, identity) } catch (ex) { err = ex }
@@ -265,7 +267,7 @@ Last-Update: 2020-12-27
})
describe(".getSerialize", function() {
-@@ -214,11 +215,11 @@
+@@ -214,11 +215,11 @@ describe("Stringify", function() {
obj.list = [obj, obj]
var json = JSON.stringify(obj, stringify.getSerialize(), 2)
@@ -279,7 +281,7 @@ Last-Update: 2020-12-27
})
// This is the behavior as of Mar 3, 2015.
-@@ -233,10 +234,10 @@
+@@ -233,10 +234,10 @@ describe("Stringify", function() {
var serializer = stringify.getSerialize()
json = JSON.stringify(obj, serializer, 2)
diff --git a/egal/.npmignore b/egal/.npmignore
deleted file mode 100644
index 70503ce..0000000
--- a/egal/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/*.tgz
-/.travis.yml
diff --git a/egal/CHANGELOG.md b/egal/CHANGELOG.md
deleted file mode 100644
index 4ca1cd3..0000000
--- a/egal/CHANGELOG.md
+++ /dev/null
@@ -1,64 +0,0 @@
-## 1.3.0 (Sep 22, 2015)
-- Adds support for calling `deepEgal` with a custom comparison function.
- Right now this is an advanced feature with its API not set in stone.
-
-## 1.2.0 (Sep 21, 2015)
-- Fixes `deepEgal` to consider `Array.prototype` equivalent to an empty array.
- JavaScript is a prototypical language after all and the prototype of an array
- is an array.
-- Fixes `egal` to consider two objects inheriting from `null` without
- `constructor` properties, but `valueOf` functions, as plain objects and not
- as value objects.
-
-- Adds support for comparing value objects that return compound values from
- their `valueOf` function. That is, you no longer need to return a single
- primitive value from `valueOf`, but merely a _more_ primitive one than before:
-
- ```javascript
- function Point(x, y) { this.x = x; this.y = y }
- Point.prototype.valueOf = function() { return [this.x, this.y] }
- egal(new Point(42, 69), new Point(42, 69)) // => true
- egal(new Point(42, 69), new Point(13, 42)) // => false
- ```
-
-## 1.1.0 (Jun 13, 2015)
-- Adds `deepEgal` for comparing plain objects and arrays recursively.
- It's still type-safe, so value objects and instances of classes nested in
- plain objects as compared as `egal` — by value if possible (same constructor
- and has a `valueOf` function), by reference (`===`) otherwise.
-
- ```javascript
- var deepEgal = require("egal").deepEgal
- function Model(name) { this.name = name }
-
- deepEgal(42, 42) // => true
- deepEgal({name: "John"}, {name: "John"}) // => true
- deepEgal({stats: {age: 13}}, {{stats: age: 13}}) // => true
- deepEgal([1, 2, 3], [1, 2, 3]) // => true
- deepEgal(new Model("John"), new Model("John")) // => false
- deepEgal(new Date(2000, 5), new Date(2000, 5)) // => true
- ```
-
-## 1.0.0 (May 25, 2015)
-- No longer considers a primitive and boxed object of the same value to be
- equivalent.
- Two boxed objects of the same value will remain equivalent.
-
- ```javascript
- egal(true, new Boolean(true)) // => false
- egal(new Boolean(true), new Boolean(true)) // => true
- ```
-
- Boxed objects tend to be *very* error prone and it's best you stick to
- primitives only. The following is a small example of problems with boxed
- objects:
-
- ```javascript
- new String("a") == new String("a") // => false
- new Boolean(true) == new Boolean(true) // => false
- Boolean(new Boolean(false)) // => true
- !!(new Boolean(false)) // => true
- ```
-
-## 0.1.337 (Nov 1, 2013)
-- First public release. Brotherhood awakes!
diff --git a/egal/LICENSE b/egal/LICENSE
deleted file mode 100644
index 95a4415..0000000
--- a/egal/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Egal.js
-Copyright (C) 2013 Andri Möll <andri@dot.ee>
-
-This program is free software: you can redistribute it and/or modify it under
-the terms of the GNU Affero General Public License as published by the Free
-Software Foundation, either version 3 of the License, or any later version.
-
-Additional permission under the GNU Affero GPL version 3 section 7:
-If you modify this Program, or any covered work, by linking or
-combining it with other code, such other code is not for that reason
-alone subject to any of the requirements of the GNU Affero GPL version 3.
-
-In summary:
-- You can use this program for no cost.
-- You can use this program for both personal and commercial reasons.
-- You do not have to share your own program's code which uses this program.
-- You have to share modifications (e.g bug-fixes) you've made to this program.
-
-For the full copy of the GNU Affero General Public License see:
-http://www.gnu.org/licenses.
diff --git a/egal/Makefile b/egal/Makefile
deleted file mode 100644
index 36088c7..0000000
--- a/egal/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-NODE_OPTS =
-TEST_OPTS =
-
-love:
- @echo "Feel like makin' love."
-
-test:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS)
-
-spec:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS)
-
-autotest:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS)
-
-autospec:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS)
-
-pack:
- @file=$$(npm pack); echo "$$file"; tar tf "$$file"
-
-publish:
- npm publish
-
-tag:
- git tag "v$$(node -e 'console.log(require("./package").version)')"
-
-clean:
- rm -f *.tgz
- npm prune --production
-
-.PHONY: love
-.PHONY: test spec autotest autospec
-.PHONY: pack publish tag
-.PHONY: clean
diff --git a/egal/README.md b/egal/README.md
deleted file mode 100644
index 5622eae..0000000
--- a/egal/README.md
+++ /dev/null
@@ -1,179 +0,0 @@
-Egal.js
-=======
-[![NPM version][npm-badge]](https://www.npmjs.com/package/egal)
-[![Build status][travis-badge]](https://travis-ci.org/moll/js-egal)
-
-Egal.js provides an `egal` function that tests **strict equality** (like
-`===`), but adds support for built-in and custom [**value
-objects**][value-object] in a **type-safe** way. It also has a `deepEgal`
-function for comparing **plain objects and arrays recursively** or deeply
-without giving up on type-safeness on the way. It also handles **circular
-references**.
-
-### Tour
-When and why to use `egal` over the triple-equals `===` operator?
-
-- When you need to compare the **semantic equivalence** of value objects without
- requiring the same object identity.
- JavaScript's `==` and `===` consider two different `Date` or `RegExp` objects
- unequal, even if they mean the same thing.
-- When you need to **compare custom value objects** in a type-safe way.
- Value objects are objects that have a [`valueOf`][valueof] function. Egal.js
- makes sure the two objects with `valueOf` are actually from the same
- constructor.
-- When you need to **compare objects or arrays recursively**, Egal.js has
- [`deepEgal`](#deep-comparison).
-
-#### Primitives
-A **primivitive** and its **boxed object** equivalent are considered different.
-Allowing unexpected boxed objects (e.g. `new Boolean(false)`) through is risky
-as they're extremely error prone (just think of `!!new Boolean(false)` returning
-`true`). Comparing two boxed objects of the same value, on the other hand, will
-work.
-
-#### Objects
-**Non-value objects**, like `Array` or `Object`, are compared by `egal` as `===`
-does it — based on object identity. For recursive or deep comparison, see
-[`deepEgal`](#deep-comparison).
-
-#### NaN
-**NaN**s (not-a-number) are **not equal** (matching how `===` behaves). This is
-because when you compare results of two mathematical operations that may both
-end up as `NaN`, you might inadvertently assume the calculations went fine. If
-you expect `NaN`, you can use JavaScript's built-in `isNaN` to test for that.
-
-#### Zeros
-**Negative and positive** zeros are **equal** (also matching how `===` behaves).
-You might end up with unexpected negative zeros via various calculations and
-when you don't need to distinguish between the two, you'll end up with too many
-false negatives. If you need to handle negative zeros differently, see the
-article on [Sameness in JavaScript][sameness].
-
-#### Value Objects
-**Value objects** can also return **compound values**. That is, you need not
-return a single primitive value from `valueOf`, but merely a _more_ primitive
-one. Those values are compared with [`deepEgal`](#deep-comparison).
-
-```javascript
-function Point(x, y) { this.x = x; this.y = y }
-Point.prototype.valueOf = function() { return [this.x, this.y] }
-egal(new Point(42, 69), new Point(42, 69)) // => true
-egal(new Point(42, 69), new Point(13, 42)) // => false
-```
-
-[npm-badge]: https://img.shields.io/npm/v/egal.svg
-[travis-badge]: https://travis-ci.org/moll/js-egal.png?branch=master
-[value-object]: https://en.wikipedia.org/wiki/Value_object
-[valueof]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf
-[sameness]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Sameness
-
-
-Installing
-----------
-### Installing on Node.js
-```
-npm install egal
-```
-
-### Installing for the browser
-Egal.js doesn't yet have a build ready for the browser, but you might be able to
-use [Browserify][browserify] to have it run there till then.
-
-[browserify]: https://github.com/substack/node-browserify
-
-
-Using
------
-Require Egal.js:
-```javascript
-var egal = require("egal")
-```
-
-Then proceed with comparions:
-```javascript
-egal(42, 42) // => true
-egal(new String("Hello!"), "Hello") // => true
-egal(new Date(2000, 5, 18), new Date(2000, 5, 18)) // => true
-egal(/abc/i, /abc/i) // => true
-```
-
-### Value Objects
-To make and compare custom value objects, create a new constructor and give its
-prototype a `valueOf` function:
-```javascript
-function Song(name) { this.name = name }
-Song.prototype.valueOf = function() { return this.name }
-
-egal(new Song("Play Guitar"), new Song("Play Guitar")) // => true
-egal(new Song("Play Guitar"), new Song("Crumblin' Down")) // => false
-```
-
-Egal.js makes sure the two instances are from the same constructor before
-comparing their `valueOf` outputs:
-```javascript
-function Song(name) { this.name = name }
-Song.prototype.valueOf = function() { return this.name }
-
-function Car(name) { this.name = name }
-Car.prototype.valueOf = function() { return this.name }
-
-egal(new Song("KITT"), new Car("KITT")) // => false
-```
-
-Objects that are instances of a class (their `constructor` property set to
-something other than `Object`) but lack a `valueOf` function, thereby not being
-value objects, are compared by reference (`===`).
-
-### Deep Comparison
-As of v1.1.0, Egal.js comes with a recursive or deep comparison function named
-`deepEgal`. It was mostly extracted from the [Must.js][must] testing library's
-`eql` function.
-
-```javascript
-var deepEgal = require("egal").deepEgal
-function Model(name) { this.name = name }
-
-deepEgal(42, 42) // => true
-deepEgal({name: "John"}, {name: "John"}) // => true
-deepEgal({stats: {age: 13}}, {{stats: age: 13}}) // => true
-deepEgal([1, 2, 3], [1, 2, 3]) // => true
-deepEgal(new Model("John"), new Model("John")) // => false
-deepEgal(new Date(2000, 5), new Date(2000, 5)) // => true
-```
-
-The `deepEgal` function compares regular primitive values, model instances and
-value objects just like `egal`.
-
-Plain objects (those with no custom `constructor` property in their
-prototype), are compared recursively by their enumerable properties. Arrays are
-compared recursively by their contents (iterating over `length`). See above
-about [value objects](#value-objects) for more details on plain, instances and
-value objects.
-
-[must]: https://github.com/moll/js-must
-
-
-License
--------
-Egal.js is released under a *Lesser GNU Affero General Public License*, which in
-summary means:
-
-- You **can** use this program for **no cost**.
-- You **can** use this program for **both personal and commercial reasons**.
-- You **do not have to share your own program's code** which uses this program.
-- You **have to share modifications** (e.g bug-fixes) you've made to this
- program.
-
-For more convoluted language, see the `LICENSE` file.
-
-
-About
------
-**[Andri Möll](http://themoll.com)** typed this and the code.
-[Monday Calendar](https://mondayapp.com) supported the engineering work.
-
-If you find Egal.js needs improving, please don't hesitate to type to me now
-at [andri@dot.ee][email] or [create an issue online][issues].
-
-[email]: mailto:andri@dot.ee
-[issues]: https://github.com/moll/js-egal/issues
diff --git a/egal/index.js b/egal/index.js
deleted file mode 100644
index bbc1cf5..0000000
--- a/egal/index.js
+++ /dev/null
@@ -1,120 +0,0 @@
-var kindof = require("kindof")
-exports = module.exports = egal
-exports.deepEgal = deepEgal
-
-function egal(a, b) {
- if (a === b) return true
-
- var type
- switch (type = kindofPlain(a)) {
- case "date":
- if (type !== kindof(b)) return false
- return a.valueOf() === b.valueOf()
-
- case "regexp":
- if (type !== kindof(b)) return false
- return a.toString() === b.toString()
-
- case "object":
- if (type !== kindofPlain(b)) return false
-
- var constructor = getConstructorOf(a)
- if (constructor !== getConstructorOf(b)) return false
- if (!hasValueOf(a) || !hasValueOf(b)) return false
- return deepEgal(a.valueOf(), b.valueOf())
-
- default: return false
- }
-}
-
-function maybeEgal(a, b) {
- if (egal(a, b)) return true
-
- var type = kindofPlain(a)
- switch (type) {
- case "array":
- case "plain": return type === kindofPlain(b) ? null : false
- default: return false
- }
-}
-
-function deepEgal(a, b, egal) {
- return deepEgalWith(typeof egal === "function" ? egal : maybeEgal, a, b)
-}
-
-function deepEgalWith(egal, a, b, aStack, bStack) {
- var equal = egal(a, b)
- if (equal != null) return Boolean(equal)
-
- var type = kindof(a)
- switch (type) {
- /* eslint no-fallthrough: 0 */
- case "array":
- case "object": if (type === kindof(b)) break
- default: return false
- }
-
- var aPos = aStack && aStack.indexOf(a)
- var bPos = bStack && bStack.indexOf(b)
- if (aPos !== bPos) return false
- if (aPos != null && aPos >= 0) return true
-
- aStack = aStack ? aStack.concat([a]) : [a]
- bStack = bStack ? bStack.concat([b]) : [b]
-
- var i
- switch (type) {
- case "array":
- if (a.length !== b.length) return false
- if (a.length === 0) return true
-
- for (i = 0; i < a.length; ++i)
- if (!deepEgalWith(egal, a[i], b[i], aStack, bStack)) return false
-
- return true
-
- case "object":
- var aKeys = keys(a)
- var bKeys = keys(b)
- if (aKeys.length !== bKeys.length) return false
- if (aKeys.length === 0) return true
-
- aKeys.sort()
- bKeys.sort()
- for (i = 0; i < aKeys.length; ++i) if (aKeys[i] !== bKeys[i]) return false
-
- for (var key in a)
- if (!deepEgalWith(egal, a[key], b[key], aStack, bStack)) return false
-
- return true
- }
-}
-
-function kindofPlain(obj) {
- var type = kindof(obj)
- if (type === "object" && isObjectPlain(obj)) return "plain"
- return type
-}
-
-function isObjectPlain(obj) {
- var prototype = Object.getPrototypeOf(obj)
- if (prototype === null) return true
- if (!("constructor" in prototype)) return true
- return prototype.constructor === Object
-}
-
-function getConstructorOf(obj) {
- var prototype = Object.getPrototypeOf(obj)
- return prototype === null ? undefined : prototype.constructor
-}
-
-function hasValueOf(obj) {
- var valueOf = obj.valueOf
- return typeof valueOf === "function" && valueOf !== Object.prototype.valueOf
-}
-
-function keys(obj) {
- var all = []
- for (var key in obj) all.push(key)
- return all
-}
diff --git a/egal/package.json b/egal/package.json
deleted file mode 100644
index 32cd8b2..0000000
--- a/egal/package.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "name": "egal",
- "version": "1.3.0",
- "description": "Strict equality test (like ===) that handles both built-in and custom value objects (those with a valueOf function).",
- "keywords": [
- "compare",
- "eql",
- "equal",
- "equality",
- "is"
- ],
- "homepage": "https://github.com/moll/js-egal",
- "bugs": "https://github.com/moll/js-egal/issues",
-
- "author": {
- "name": "Andri Möll",
- "email": "andri@dot.ee",
- "url": "http://themoll.com"
- },
-
- "repository": {
- "type": "git",
- "url": "git://github.com/moll/js-egal.git"
- },
-
- "licenses": [{
- "type": "LAGPL",
- "url": "https://github.com/moll/js-egal/blob/master/LICENSE"
- }],
-
- "main": "index.js",
- "scripts": {"test": "make test"},
-
- "dependencies": {
- "kindof": ">= 2.0.0 < 3"
- },
-
- "devDependencies": {
- "mocha": ">= 1.12.0 < 2",
- "must": ">= 0.12.0 < 0.13",
- "sinon": ">= 1.15.3 < 2",
- "lodash.wrap": ">= 3.0.0 < 4"
- }
-}
diff --git a/egal/test/_boolean_test.js b/egal/test/_boolean_test.js
deleted file mode 100644
index 061e0fd..0000000
--- a/egal/test/_boolean_test.js
+++ /dev/null
@@ -1,29 +0,0 @@
-module.exports = function(egal) {
- // Allow using Boolean as constructor:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- describe("given Boolean", function() {
- it("must return true given identical primitives", function() {
- egal(true, true).must.be.true()
- })
-
- it("must return false given unequivalent primitives", function() {
- egal(true, false).must.be.false()
- })
-
- it("must return true given equivalent objects", function() {
- egal(new Boolean(true), new Boolean(true)).must.be.true()
- })
-
- it("must return false given unequivalent objects", function() {
- egal(new Boolean(true), new Boolean(false)).must.be.false()
- })
-
- it("must return false given equivalent primitive and object", function() {
- egal(true, new Boolean(true)).must.be.false()
- egal(false, new Boolean(false)).must.be.false()
- })
- })
-}
-
diff --git a/egal/test/_date_test.js b/egal/test/_date_test.js
deleted file mode 100644
index 0f5b29f..0000000
--- a/egal/test/_date_test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-module.exports = function(egal) {
- describe("given Date", function() {
- it("must return true given equivalent dates", function() {
- egal(new Date(2000, 5), new Date(2000, 5)).must.be.true()
- })
-
- it("must return false given unequivalent dates", function() {
- egal(new Date(2000, 5), new Date(1999, 5)).must.be.false()
- })
-
- it("must return false given Date and number primitive", function() {
- egal(new Date(1337), 1337).must.be.false()
- })
- })
-}
diff --git a/egal/test/_function_test.js b/egal/test/_function_test.js
deleted file mode 100644
index 4ba4e1b..0000000
--- a/egal/test/_function_test.js
+++ /dev/null
@@ -1,12 +0,0 @@
-module.exports = function(egal) {
- describe("given Function", function() {
- it("must return true given identical functions", function() {
- function fn() {}
- egal(fn, fn).must.be.true()
- })
-
- it("must return false given equivalent functions", function() {
- egal(function() {}, function() {}).must.be.false()
- })
- })
-}
diff --git a/egal/test/_null_test.js b/egal/test/_null_test.js
deleted file mode 100644
index 2fd0f1f..0000000
--- a/egal/test/_null_test.js
+++ /dev/null
@@ -1,13 +0,0 @@
-module.exports = function(egal) {
- it("must return true given nulls", function() {
- egal(null, null).must.be.true()
- })
-
- it("must return true given undefineds", function() {
- egal(undefined, undefined).must.be.true()
- })
-
- it("must return false given null and undefined", function() {
- egal(null, undefined).must.be.false()
- })
-}
diff --git a/egal/test/_number_test.js b/egal/test/_number_test.js
deleted file mode 100644
index ab18928..0000000
--- a/egal/test/_number_test.js
+++ /dev/null
@@ -1,93 +0,0 @@
-module.exports = function(egal) {
- // Allow using Number as constructor:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- describe("given Number", function() {
- it("must return true given identical primitives", function() {
- egal(42, 42).must.be.true()
- })
-
- it("must return false given unequivalent primitives", function() {
- egal(42, 69).must.be.false()
- })
-
- it("must return true given equivalent objects", function() {
- egal(new Number(42), new Number(42)).must.be.true()
- })
-
- it("must return false given unequivalent objects", function() {
- egal(new Number(42), new Number(69)).must.be.false()
- })
-
- it("must return false given equivalent primitive and object", function() {
- egal(42, new Number(42)).must.be.false()
- })
-
- it("must return false given string primitive", function() {
- egal(42, "69").must.be.false()
- })
-
- it("must return false given string object", function() {
- egal(42, new String("69")).must.be.false()
- })
-
- describe("given -0", function() {
- it("must return true given primitives", function() {
- egal(-0, +0).must.be.true()
- })
-
- it("must return true given objects", function() {
- egal(new Number(-0), new Number(+0)).must.be.true()
- })
-
- it("must return false given primitive and object", function() {
- egal(-0, new Number(+0)).must.be.false()
- })
- })
-
- describe("given NaN", function() {
- it("must return false given primitives", function() {
- egal(NaN, NaN).must.be.false()
- })
-
- it("must return false given objects", function() {
- egal(new Number(NaN), new Number(NaN)).must.be.false()
- })
-
- it("must return false given number and NaN", function() {
- egal(42, NaN).must.be.false()
- })
- })
-
- describe("given Infinity", function() {
- it("must return true given identical primitivies", function() {
- egal(Infinity, Infinity).must.be.true()
- egal(-Infinity, -Infinity).must.be.true()
- })
-
- it("must return false given unequivalent primitives", function() {
- egal(Infinity, -Infinity).must.be.false()
- })
-
- it("must return true given equivalent objects", function() {
- egal(new Number(Infinity), new Number(Infinity)).must.be.true()
- egal(new Number(-Infinity), new Number(-Infinity)).must.be.true()
- })
-
- it("must return false given unequivalent objects", function() {
- egal(new Number(Infinity), new Number(-Infinity)).must.be.false()
- })
-
- it("must return false given equivalent primitive and object", function() {
- egal(Infinity, new Number(Infinity)).must.be.false()
- egal(new Number(-Infinity), -Infinity).must.be.false()
- })
-
- it("must return false given number and infinity", function() {
- egal(42, Infinity).must.be.false()
- egal(42, -Infinity).must.be.false()
- })
- })
- })
-}
diff --git a/egal/test/_object_with_constructor_test.js b/egal/test/_object_with_constructor_test.js
deleted file mode 100644
index cae73cb..0000000
--- a/egal/test/_object_with_constructor_test.js
+++ /dev/null
@@ -1,27 +0,0 @@
-module.exports = function(egal) {
- describe("given Object with constructor", function() {
- it("must return false given equivalent objects", function() {
- function Value() {}
- egal(new Value, new Value).must.be.false()
- })
-
- it("must return false given different constructors", function() {
- function Value() {}
- function Price() {}
- egal(new Value, new Price).must.be.false()
- })
-
- it("must return false given subclassed constructor", function() {
- function Value(value) { this.value = value }
-
- function MoreValue(value) { this.value = value }
- MoreValue.prototype = Object.create(Value.prototype, {
- constructor: {value: MoreValue, configurable: true, writable: true}
- })
-
- var a = new Value(42)
- var b = new MoreValue(42)
- egal(a, b).must.be.false()
- })
- })
-}
diff --git a/egal/test/_object_with_value_of_test.js b/egal/test/_object_with_value_of_test.js
deleted file mode 100644
index fb291bb..0000000
--- a/egal/test/_object_with_value_of_test.js
+++ /dev/null
@@ -1,155 +0,0 @@
-module.exports = function(egal) {
- describe("given Object with valueOf", function() {
- it("must return true given equal value", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return this.value }
- var a = new Value(42)
- var b = new Value(42)
- egal(a, b).must.be.true()
- })
-
- it("must return true given equal value with unequivalent properties",
- function() {
- function Value(value, other) { this.value = value; this.other = other }
- Value.prototype.valueOf = function() { return this.value }
- var a = new Value(42, 1)
- var b = new Value(42, 2)
- egal(a, b).must.be.true()
- })
-
- it("must return true given equal value but different valueOfs", function() {
- function Value(value) { this.valueOf = function() { return value } }
- var a = new Value(42)
- var b = new Value(42)
- egal(a, b).must.be.true()
- })
-
- it("must return false given unequivalent values", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return this.value }
- var a = new Value(42)
- var b = new Value(69)
- egal(a, b).must.be.false()
- })
-
- it("must return false given differently typed values", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return this.value }
- var a = new Value(42)
- var b = new Value("42")
- egal(a, b).must.be.false()
- })
-
- it("must return true given equivalent array values", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return [42, this.value] }
- var a = new Value(42)
- var b = new Value(42)
- egal(a, b).must.be.true()
- })
-
- it("must return false given unequivalent array values", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return [42, this.value] }
- var a = new Value(42)
- var b = new Value(69)
- egal(a, b).must.be.false()
- })
-
- xit("must return false given valueOfs returning self", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return this }
- var a = new Value(42)
- var b = new Value(42)
- egal(a, b).must.be.false()
- })
-
- it("must return true given null inherited value objects", function() {
- function Value(value) { this.value = value }
-
- Value.prototype = Object.create(null, {
- constructor: {value: Value, configurable: true, writeable: true}
- })
-
- Value.prototype.valueOf = function() { return this.value }
-
- var a = new Value(42)
- var b = new Value(42)
- egal(a, b).must.be.true()
- })
-
- it("must return false given instance and plain object", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return this.value }
-
- var a = new Value(42)
- var b = {valueOf: function() { return 42 }}
- egal(a, b).must.be.false()
- })
-
- it("must return false given different constructors", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return this.value }
- function Price(value) { this.value = value }
- Price.prototype.valueOf = function() { return this.value }
-
- var a = new Value(42)
- var b = new Price(42)
- egal(a, b).must.be.false()
- })
-
- it("must return false given subclassed constructor", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return this.value }
-
- function MoreValue(value) { this.value = value }
- MoreValue.prototype = Object.create(Value.prototype, {
- constructor: {value: MoreValue, configurable: true, writable: true}
- })
-
- var a = new Value(42)
- var b = new MoreValue(42)
- egal(a, b).must.be.false()
- })
-
- it("must return false given overwritten constructor properties",
- function() {
- function A(value) { this.value = value }
- A.prototype.valueOf = function() { return this.value }
- function B(value) { this.value = value }
- B.prototype.valueOf = function() { return this.value }
-
- var a = new A(42)
- var b = new B(42)
- a.constructor = b.constructor = function() {}
- egal(a, b).must.be.false()
- })
-
- it("must return false given non-function valueOfs", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = 42
- var a = new Value(42)
- var b = new Value(42)
- egal(a, b).must.be.false()
- })
-
- it("must return false given default Object.prototype.valueOf", function() {
- function Value(value) { this.value = value }
- var a = new Value(42)
- var b = new Value(42)
- egal(a, b).must.be.false()
- })
-
- it("must return false given plain object", function() {
- var a = {valueOf: function() { return 1 }}
- var b = {valueOf: function() { return 1 }}
- egal(a, b).must.be.false()
- })
-
- it("must return false given null inherited plain objects", function() {
- var a = Object.create(null); a.valueOf = function() { return 42 }
- var b = Object.create(null); b.valueOf = function() { return 42 }
- egal(a, b).must.be.false()
- })
- })
-}
diff --git a/egal/test/_regexp_test.js b/egal/test/_regexp_test.js
deleted file mode 100644
index 0c2e12b..0000000
--- a/egal/test/_regexp_test.js
+++ /dev/null
@@ -1,19 +0,0 @@
-module.exports = function(egal) {
- describe("given RegExp", function() {
- it("must return true given equivalent primitives", function() {
- egal(/a/, /a/).must.be.true()
- })
-
- it("must return false given unequivalent primitives", function() {
- egal(/a/, /b/).must.be.false()
- })
-
- it("must return false if given unequivalent flags", function() {
- egal(/a/ig, /a/i).must.be.false()
- })
-
- it("must return false given RegExp and string primitive", function() {
- egal(/a/, "/a/").must.be.false()
- })
- })
-}
diff --git a/egal/test/_string_test.js b/egal/test/_string_test.js
deleted file mode 100644
index d084e84..0000000
--- a/egal/test/_string_test.js
+++ /dev/null
@@ -1,35 +0,0 @@
-module.exports = function(egal) {
- // Allow using String as constructor:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- describe("given String", function() {
- it("must return true given identical primitives", function() {
- egal("ok", "ok").must.be.true()
- })
-
- it("must return false given unequivalent primitives", function() {
- egal("ok", "no").must.be.false()
- })
-
- it("must return true given equivalent objects", function() {
- egal(new String("ok"), new String("ok")).must.be.true()
- })
-
- it("must return false given unequivalent objects", function() {
- egal(new String("ok"), new String("no")).must.be.false()
- })
-
- it("must return false given equivalent primitive and object", function() {
- egal("ok", new String("ok")).must.be.false()
- })
-
- it("must return false given number primitive", function() {
- egal("42", 42).must.be.false()
- })
-
- it("must return false given number object", function() {
- egal("42", new Number(42)).must.be.false()
- })
- })
-}
diff --git a/egal/test/_symbol_test.js b/egal/test/_symbol_test.js
deleted file mode 100644
index af5fc10..0000000
--- a/egal/test/_symbol_test.js
+++ /dev/null
@@ -1,18 +0,0 @@
-var describe = typeof Symbol == "undefined" ? global.xdescribe : global.describe
-
-module.exports = function(egal) {
- describe("given Symbol", function() {
- it("must return true given the same symbol", function() {
- var symbol = Symbol()
- egal(symbol, symbol).must.be.true()
- })
-
- it("must return false given two anonymous symbols", function() {
- egal(Symbol(), Symbol()).must.be.false()
- })
-
- it("must return false given two named symbols", function() {
- egal(Symbol("iterator"), Symbol("iterator")).must.be.false()
- })
- })
-}
diff --git a/egal/test/index_test.js b/egal/test/index_test.js
deleted file mode 100644
index fc363c3..0000000
--- a/egal/test/index_test.js
+++ /dev/null
@@ -1,436 +0,0 @@
-var Sinon = require("sinon")
-var wrap = require("lodash.wrap")
-
-describe("egal", function() {
- var egal = wrap(require(".."), function(orig, a, b) {
- var equal = orig(a, b)
- orig(b, a).must.equal(equal)
- return equal
- })
-
- require("./_null_test")(egal)
- require("./_boolean_test")(egal)
- require("./_number_test")(egal)
- require("./_string_test")(egal)
- require("./_symbol_test")(egal)
- require("./_regexp_test")(egal)
- require("./_date_test")(egal)
- require("./_function_test")(egal)
- require("./_object_with_value_of_test")(egal)
-
- it("must return false given an empty array and empty object", function() {
- // There was once an assertion library that considered {} equivalent to []
- // for months! This will *never* happen under my watch!
- egal({}, []).must.be.false()
- })
-
- describe("given Array", function() {
- it("must return true given same array", function() {
- var array = []
- egal(array, array).must.be.true()
- })
-
- it("must return false given empty arrays", function() {
- egal([], []).must.be.false()
- })
-
- it("must return false given equivalent arrays", function() {
- egal([1], [1]).must.be.false()
- })
- })
-
- describe("given Object", function() {
- it("must return true given same object", function() {
- var object = {}
- egal(object, object).must.be.true()
- })
-
- it("must return false given empty objects", function() {
- egal({}, {}).must.be.false()
- })
-
- it("must return false given equivalent objects", function() {
- egal({a: 1}, {a: 1}).must.be.false()
- })
-
- it("must return false given null inherited object", function() {
- var a = Object.create(null)
- var b = Object.create(null)
- egal(a, b).must.be.false()
- })
-
- it("must return false given instance and plain object", function() {
- function Model() {}
- egal(new Model, {}).must.be.false()
- })
- })
-})
-
-describe("deepEgal", function() {
- var deepEgal = wrap(require("..").deepEgal, function(orig, a, b, egal) {
- var equal = orig(a, b, egal)
- orig(b, a, egal).must.equal(equal)
- return equal
- })
-
- it("must return false given an empty array and empty object", function() {
- deepEgal({}, []).must.be.false()
- })
-
- require("./_null_test")(deepEgal)
- require("./_boolean_test")(deepEgal)
- require("./_number_test")(deepEgal)
- require("./_string_test")(deepEgal)
- require("./_symbol_test")(deepEgal)
- require("./_regexp_test")(deepEgal)
- require("./_date_test")(deepEgal)
- require("./_function_test")(deepEgal)
- require("./_object_with_constructor_test")(deepEgal)
- require("./_object_with_value_of_test")(deepEgal)
-
- describe("given Array", function() {
- it("must return true given equivalent empty arrays", function() {
- deepEgal([], []).must.be.true()
- })
-
- it("must return true given empty array and Array.prototype", function() {
- deepEgal([], Array.prototype).must.be.true()
- })
-
- it("must return true given equivalent arrays", function() {
- deepEgal([1], [1]).must.be.true()
- deepEgal([1, 2, 3], [1, 2, 3]).must.be.true()
- })
-
- it("must return true given identical arrays", function() {
- var array = []
- deepEgal(array, array).must.be.true()
- })
-
- it("must return false given an empty and non-empty array", function() {
- deepEgal([], [1]).must.be.false()
- })
-
- it("must return false given a smaller and a larger array", function() {
- deepEgal([1], [1, 2]).must.be.false()
- })
-
- it("must return true given equivalent nested arrays", function() {
- deepEgal([1, [2], 3], [1, [2], 3]).must.be.true()
- })
-
- it("must return false given unequivalent nested arrays", function() {
- deepEgal([1, [2], 3], [1, [42], 3]).must.be.false()
- })
-
- describe("with circular references", function() {
- it("must return true if equal", function() {
- var a = [1, 2, 3]
- a.push(a)
- a.push(5)
-
- var b = [1, 2, 3]
- b.push(b)
- b.push(5)
-
- deepEgal(a, b).must.be.true()
- })
-
- it("must return false if only one circular", function() {
- var a = [1, 2, 3]
- a.push(a)
- a.push(5)
- var b = [1, 2, 3, [1, 2, 3, 5], 5]
- deepEgal(a, b).must.be.false()
- })
-
- it("must return false if circular to different levels", function() {
- var a = [1, 2, 3]
- a.push(a)
-
- var b = [1, 2, 3]
- var bInside = [1, 2, 3]
- bInside.push(bInside)
- b.push(bInside)
-
- deepEgal(a, b).must.be.false()
- })
- })
-
- describe("with nested values", function() {
- function nestedDeepEgal(a, b) { return deepEgal([a], [b]) }
-
- require("./_null_test")(nestedDeepEgal)
- require("./_boolean_test")(nestedDeepEgal)
- require("./_number_test")(nestedDeepEgal)
- require("./_string_test")(nestedDeepEgal)
- require("./_symbol_test")(nestedDeepEgal)
- require("./_regexp_test")(nestedDeepEgal)
- require("./_date_test")(nestedDeepEgal)
- require("./_function_test")(nestedDeepEgal)
- require("./_object_with_constructor_test")(nestedDeepEgal)
- require("./_object_with_value_of_test")(nestedDeepEgal)
- })
- })
-
- describe("given Object", function() {
- it("must return true given identical objects", function() {
- var obj = {a: 42, b: 69}
- deepEgal(obj, obj).must.be.true()
- })
-
- it("must return true given empty objects", function() {
- deepEgal({}, {}).must.be.true()
- })
-
- it("must return false given an empty and filled object", function() {
- deepEgal({}, {name: "John"}).must.be.false()
- })
-
- it("must return false given a smaller and larger object", function() {
- var a = {a: 42, b: 69}
- var b = {a: 42}
- deepEgal(a, b).must.be.false()
- })
-
- // This was a bug I discovered on Jun 12, 2015 related to not comparing
- // keys equivalence before comparing their values.
- it("must return false given equal amount of keys undefined keys",
- function() {
- deepEgal({name: undefined}, {age: undefined}).must.be.false()
- deepEgal({name: undefined}, {age: 13}).must.be.false()
- })
-
- it("must return true given equivalent objects", function() {
- var a = {a: 42, b: 69}
- var b = {a: 42, b: 69}
- deepEgal(a, b).must.be.true()
- })
-
- it("must return false given objects with differently typed properties",
- function() {
- var a = {a: "42", b: 69}
- var b = {a: 42, b: 69}
- deepEgal(a, b).must.be.false()
- })
-
- it("must return true given an object with set constructor property",
- function() {
- var a = {constructor: 1337}
- var b = {constructor: 1337}
- deepEgal(a, b).must.be.true()
- })
-
- it("must return true given a deep object", function() {
- var a = {life: {love: 69}}
- var b = {life: {love: 69}}
- deepEgal(a, b).must.be.true()
- })
-
- it("must return false given an unequivalent deep object", function() {
- var a = {life: {love: 69}}
- var b = {life: {love: 42}}
- deepEgal(a, b).must.be.false()
- })
-
- describe("with circular references", function() {
- it("must return true if equal", function() {
- var a = {life: {love: 69}}
- a.self = a
-
- var b = ({life: {love: 69}})
- b.self = b
-
- deepEgal(a, b).must.be.true()
- })
-
- it("must return false if only one circular", function() {
- var a = ({life: {love: 69}})
- a.self = a
-
- var b = ({life: {love: 69}})
- b.self = {life: {love: 69}, self: {}}
-
- deepEgal(a, b).must.be.false()
- })
-
- it("must return false if circular to different levels", function() {
- var a = ({life: {love: 69}})
- a.self = a
-
- var b = ({life: {love: 69}})
- var bInside = ({life: {love: 69}})
- bInside.self = bInside
- b.self = bInside
-
- deepEgal(a, b).must.be.false()
- })
- })
-
- describe("with inheritance", function() {
- it("must return true given empty inherited objects", function() {
- var a = Object.create({})
- var b = Object.create({})
- deepEgal(a, b).must.be.true()
- })
-
- it("must return true given empty ancestored objects", function() {
- var a = Object.create(Object.create({}))
- var b = Object.create(Object.create({}))
- deepEgal(a, b).must.be.true()
- })
-
- it("must return true given empty objects inherited from null",
- function() {
- var a = Object.create(null)
- var b = Object.create(null)
- deepEgal(a, b).must.be.true()
- })
-
- it("must return true given empty objects ancestored from null",
- function() {
- var a = Object.create(Object.create(null))
- var b = Object.create(Object.create(null))
- deepEgal(a, b).must.be.true()
- })
-
- it("must return true given equivalent inherited objects", function() {
- var a = Object.create({love: 42})
- var b = Object.create({love: 42})
- deepEgal(a, b).must.be.true()
- })
-
- it("must return true given equivalent ancestored objects", function() {
- var a = Object.create(Object.create({love: 42}))
- var b = Object.create(Object.create({love: 42}))
- deepEgal(a, b).must.be.true()
- })
-
- it("must return true given equivalent objects inherited from null",
- function() {
- var a = Object.create(null, {life: {value: 42, enumerable: true}})
- var b = Object.create(null, {life: {value: 42, enumerable: true}})
- deepEgal(a, b).must.be.true()
- })
-
- it("must return true given equivalent objects ancestored from null",
- function() {
- var a = Object.create(Object.create(null, {
- life: {value: 42, enumerable: true}
- }))
-
- var b = Object.create(Object.create(null, {
- life: {value: 42, enumerable: true}
- }))
-
- deepEgal(a, b).must.be.true()
- })
-
- it("must return false given unequivalent inherited objects", function() {
- var a = Object.create({love: 42})
- var b = Object.create({love: 69})
- deepEgal(a, b).must.be.false()
- })
-
- it("must return false given unequivalent ancestored objects", function() {
- var a = Object.create(Object.create({love: 42}))
- var b = Object.create(Object.create({love: 69}))
- deepEgal(a, b).must.be.false()
- })
-
- it("must return false given unequivalent objects inherited from null",
- function() {
- var a = Object.create(null, {life: {value: 42, enumerable: true}})
- var b = Object.create(null, {life: {value: 69, enumerable: true}})
- deepEgal(a, b).must.be.false()
- })
-
- it("must return false given unequivalent objects ancestored from null",
- function() {
- var a = Object.create(Object.create(null, {
- life: {value: 42, enumerable: true}
- }))
-
- var b = Object.create(Object.create(null, {
- life: {value: 69, enumerable: true}
- }))
-
- deepEgal(a, b).must.be.false()
- })
- })
-
- describe("with nested values", function() {
- function nestedDeepEgal(a, b) { return deepEgal({key: a}, {key: b}) }
-
- require("./_null_test")(nestedDeepEgal)
- require("./_boolean_test")(nestedDeepEgal)
- require("./_number_test")(nestedDeepEgal)
- require("./_string_test")(nestedDeepEgal)
- require("./_symbol_test")(nestedDeepEgal)
- require("./_regexp_test")(nestedDeepEgal)
- require("./_date_test")(nestedDeepEgal)
- require("./_function_test")(nestedDeepEgal)
- require("./_object_with_constructor_test")(nestedDeepEgal)
- require("./_object_with_value_of_test")(nestedDeepEgal)
- })
- })
-
- describe("given egal function", function() {
- var deepEgal = require("..").deepEgal
-
- it("must be called with initial values", function() {
- var egal = Sinon.spy()
- var a = {}, b = {}
- deepEgal(a, b, egal)
-
- egal.callCount.must.equal(1)
- egal.args[0].length.must.equal(2)
- egal.args[0][0].must.equal(a)
- egal.args[0][1].must.equal(b)
- })
-
- it("must not recurse if function returns true", function() {
- var egal = Sinon.spy(function() { return true })
- deepEgal([42], [69], egal).must.be.true()
- egal.callCount.must.equal(1)
- egal.args[0].must.eql([[42], [69]])
- })
-
- it("must recurse if function returns null", function() {
- var egal = Sinon.spy(function() { return null })
- deepEgal([42], [42], egal).must.be.false()
- egal.callCount.must.equal(2)
- egal.args[0].must.eql([[42], [42]])
- egal.args[1].must.eql([42, 42])
- })
-
- it("must not recurse if function returns false", function() {
- var egal = Sinon.spy(function() { return false })
- deepEgal([42], [69], egal).must.be.false()
- egal.callCount.must.equal(1)
- egal.args[0].must.eql([[42], [69]])
- })
-
- it("must be called when recursing to arrays", function() {
- var egal = Sinon.spy()
- var a = {}, b = {}
- deepEgal([a], [b], egal)
-
- egal.callCount.must.equal(2)
- egal.args[1].length.must.equal(2)
- egal.args[1][0].must.equal(a)
- egal.args[1][1].must.equal(b)
- })
-
- it("must be called when recursing into objects", function() {
- var egal = Sinon.spy()
- var a = {}, b = {}
- deepEgal({key: a}, {key: b}, egal)
-
- egal.callCount.must.equal(2)
- egal.args[1].length.must.equal(2)
- egal.args[1][0].must.equal(a)
- egal.args[1][1].must.equal(b)
- })
- })
-})
diff --git a/egal/test/mocha.opts b/egal/test/mocha.opts
deleted file mode 100644
index 2661ca1..0000000
--- a/egal/test/mocha.opts
+++ /dev/null
@@ -1,3 +0,0 @@
---recursive
---require must
---check-leaks
diff --git a/kindof/.npmignore b/kindof/.npmignore
deleted file mode 100644
index 8cff5a5..0000000
--- a/kindof/.npmignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/.travis.yml
-/.testem.json
-/*.tgz
diff --git a/kindof/.testem.json b/kindof/.testem.json
deleted file mode 100644
index a3aa415..0000000
--- a/kindof/.testem.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "framework": "mocha",
- "src_files": ["index.js", "test/*_test.js"],
- "serve_files": ["browser.js"],
- "before_tests": "browserify test/index_test.js -o browser.js"
-}
diff --git a/kindof/CHANGELOG.md b/kindof/CHANGELOG.md
deleted file mode 100644
index 14e8ff6..0000000
--- a/kindof/CHANGELOG.md
+++ /dev/null
@@ -1,22 +0,0 @@
-## 2.0.0 (May 25, 2015)
-- Removes support for boxed objects (`new Boolean`, `new Number`, `new String`)
- and considers them just as objects.
-
- Boxed objects tend to be *very* error prone and it's best you stick to
- primitives only. The following is a small example of problems with boxed
- objects:
-
- ```javascript
- new String("a") == new String("a") // => false
- new Boolean(true) == new Boolean(true) // => false
- Boolean(new Boolean(false)) // => true
- !!(new Boolean(false)) // => true
- ```
-
- You can convert boxed objects to primitives by calling their `valueOf`
- function:
- ```javascript
- new String("Hello").valueOf() // => "Hello"
- ```
-
-- Adds support for `Symbol`.
diff --git a/kindof/LICENSE b/kindof/LICENSE
deleted file mode 100644
index 909bda1..0000000
--- a/kindof/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Kindof.js
-Copyright (C) 2013 Andri Möll <andri@dot.ee>
-
-This program is free software: you can redistribute it and/or modify it under
-the terms of the GNU Affero General Public License as published by the Free
-Software Foundation, either version 3 of the License, or any later version.
-
-Additional permission under the GNU Affero GPL version 3 section 7:
-If you modify this Program, or any covered work, by linking or
-combining it with other code, such other code is not for that reason
-alone subject to any of the requirements of the GNU Affero GPL version 3.
-
-In summary:
-- You can use this program for no cost.
-- You can use this program for both personal and commercial reasons.
-- You do not have to share your own program's code which uses this program.
-- You have to share modifications (e.g bug-fixes) you've made to this program.
-
-For the full copy of the GNU Affero General Public License see:
-http://www.gnu.org/licenses.
diff --git a/kindof/Makefile b/kindof/Makefile
deleted file mode 100644
index 36088c7..0000000
--- a/kindof/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-NODE_OPTS =
-TEST_OPTS =
-
-love:
- @echo "Feel like makin' love."
-
-test:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS)
-
-spec:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS)
-
-autotest:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS)
-
-autospec:
- @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS)
-
-pack:
- @file=$$(npm pack); echo "$$file"; tar tf "$$file"
-
-publish:
- npm publish
-
-tag:
- git tag "v$$(node -e 'console.log(require("./package").version)')"
-
-clean:
- rm -f *.tgz
- npm prune --production
-
-.PHONY: love
-.PHONY: test spec autotest autospec
-.PHONY: pack publish tag
-.PHONY: clean
diff --git a/kindof/README.md b/kindof/README.md
deleted file mode 100644
index 73dd93a..0000000
--- a/kindof/README.md
+++ /dev/null
@@ -1,173 +0,0 @@
-Kindof.js
-=========
-[![NPM version][npm-badge]](https://www.npmjs.com/package/kindof)
-[![Build status][travis-badge]](https://travis-ci.org/moll/js-kindof)
-
-Kindof.js **provides a single `kindof` function** that does what you'd expect
-from `typeof` — gives you the proper semantic type regardless if the variable
-was a **primitive** (`"Hello"`), a **built-in [value object][value-object]**
-like (`new Date(2000, 5, 18)` or `/.*/`) or came from **another execution
-context** (e.g. an array from another `<iframe>`).
-
-### Tour
-When and why should you use `kindof` over `typeof`?
-
-- When you need a type check that returns `"null"` given the `null` value.
- You might remember, JavaScript's `typeof` says `null` is an object.
-- When you need to **differentiate** between **plain objects** (`{name:
- "John"}`) and **built-in value objects** (`new Date(2000, 5, 18)`).
- A single `kindof(obj) == "date"` check makes that easy.
-- When there's a chance you might get an object from **another execution
- context**.
- In the browser that might mean an object from another `<frame>`.
- Different execution contexts have different built-in class instances, so you
- can't do `obj instanceof Date` safely.
-- Kindof.js does not consider boxed objects (instances of `Boolean`, `Number`
- and `String`) to of the same type as their primitive counterparts. See below
- for why boxed objects are very error prone and should be avoided.
-
-Kindof.js supports all ECMAScript **built-in types and primitives**:
-`undefined`, `null`, `Boolean`, `Number`, `String`, `Symbol`, `RegExp`, `Date`,
-`Array`, `Function` and plain old `Object`. Others, e.g. `Math` and `JSON`, are
-considered just objects. In general, objects that behave like **value objects**
-(dates, regular expressions etc.) or proper arrays have a kind other than
-`object`.
-
-Please see the table below for the full list of kinds.
-
-### Primitives and Boxed Objects
-You might know, JavaScript has both primitive types and boxed object types for
-booleans, numbers and strings. Primitives are what you get from code literals
-(`true`, `42`, `"Hello"`) and from `JSON.parse`. Boxed objects tend to only
-appear when someone explicitly calls their constructor (`new Boolean(false)`).
-
-Boxed objects wouldn't be so bad, except JavaScript's equivalence operator
-(`==`), for all its type coercions, doesn't handle them transparently. While you
-can't compare other value types like dates and regular expressions with `==`
-either, you won't make that mistake that easily. The following is a small
-example of problems with boxed objects:
-
-```javascript
-new String("a") == new String("a") // => false
-new Boolean(true) == new Boolean(true) // => false
-Boolean(new Boolean(false)) // => true
-!!(new Boolean(false)) // => true
-```
-
-If you still wish Kindof to consider boxed Boolean, Number and String types like
-primitives (returning `"boolean"`, `"number"` and `"string"` respectively), feel
-free to use [Kindof.js's v1 branch][v1] with `npm install kindof@1`.
-
-[value-object]: https://en.wikipedia.org/wiki/Value_object
-[v1]: https://github.com/moll/js-kindof/tree/v1
-[npm-badge]: https://img.shields.io/npm/v/kindof.svg
-[travis-badge]: https://travis-ci.org/moll/js-kindof.png?branch=master
-
-
-Installing
-----------
-**Note**: Kindof.js follows [semantic versioning](http://semver.org/).
-
-### Installing for the browser
-Take the `kindof.js` file and source it at will.
-
-### Installing on Node.js
-Install with `npm install kindof`.
-And require with `var kindof = require("kindof")`.
-
-
-Using
------
-Pass any object to `kindof` and compare its output to what you expect:
-```javascript
-kindof("Hello") // => "string"
-kindof(new Date(2000, 5, 18)) // => "date"
-```
-
-A switch statement might help:
-```javascript
-switch (kindof(obj)) {
- case "null": this.name = "Alfred"; break
- case "string": this.name = obj; break
- case "date": this.birthdate = obj; break
- default: throw new TypeError("Pardon, sir, came upon an unexpected type.")
-}
-```
-
-
-Kinds
------
-The pattern is simple and follows `typeof`: besides primitives, built-in objects
-that are **value objects** (dates, regular expressions etc.) or **real arrays**
-are of a kind other than `object`. The `arguments` object, for example, is not
-a proper array and is therefore an `object`.
-
-Value | Kindof
-----------------------|----------
-`undefined `| undefined
-`null `| null
-`true `| boolean
-`false `| boolean
-`42 `| number
-`NaN `| number
-`Infinity `| number
-`"Hello" `| string
-`Symbol() `| symbol
-`Symbol("forEach") `| symbol
-`Symbol.iterator `| symbol
-`/.*/ `| regexp
-`new RegExp(".*") `| regexp
-`new Date `| date
-`[42, 69] `| array
-`function() {} `| function
-`{} `| object
-`arguments `| object
-`new Boolean(true) `| object
-`new Number(42) `| object
-`new String("Hello") `| object
-`new MyClass `| object
-`new Error `| object
-`Math `| object
-`JSON `| object
-
-**Subclassed objects**, such as subclassed arrays, are considered to be `object`
-unless their internal `[[Class]]` property remains that of the original. For
-ways to subclass properly, please see further reading below.
-
-
-Further Reading
----------------
-- The [`typeof` operator in ECMAScript 5.1][typeof-ecma].
-- The [`typeof` operator as implemented by Firefox][typeof-firefox].
-- Article on [subclassing `Array`][subclass] by [Juriy Zaytsev][juriy].
-
-[typeof-ecma]: http://www.ecma-international.org/ecma-262/5.1/#sec-11.4.3
-[typeof-firefox]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
-[subclass]: http://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/
-[juriy]: http://perfectionkills.com
-
-
-License
--------
-Kindof.js is released under a *Lesser GNU Affero General Public License*, which
-in summary means:
-
-- You **can** use this program for **no cost**.
-- You **can** use this program for **both personal and commercial reasons**.
-- You **do not have to share your own program's code** which uses this program.
-- You **have to share modifications** (e.g bug-fixes) you've made to this
- program.
-
-For more convoluted language, see the `LICENSE` file.
-
-
-About
------
-**[Andri Möll](http://themoll.com)** typed this and the code.
-[Monday Calendar](https://mondayapp.com) supported the engineering work.
-
-If you find Kindof.js needs improving, please don't hesitate to type to me now
-at [andri@dot.ee][email] or [create an issue online][issues].
-
-[email]: mailto:andri@dot.ee
-[issues]: https://github.com/moll/js-kindof/issues
diff --git a/kindof/kindof.js b/kindof/kindof.js
deleted file mode 100644
index 44b277e..0000000
--- a/kindof/kindof.js
+++ /dev/null
@@ -1,18 +0,0 @@
-if (typeof module != "undefined") module.exports = kindof
-
-function kindof(obj) {
- var type
- if (obj === undefined) return "undefined"
- if (obj === null) return "null"
-
- switch (type = typeof obj) {
- case "object":
- switch (Object.prototype.toString.call(obj)) {
- case "[object RegExp]": return "regexp"
- case "[object Date]": return "date"
- case "[object Array]": return "array"
- }
-
- default: return type
- }
-}
diff --git a/kindof/package.json b/kindof/package.json
deleted file mode 100644
index 064e7a3..0000000
--- a/kindof/package.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "kindof",
- "version": "2.0.0",
- "description": "A proper typeof that works with primitives, built-in value objects and those from other execution contexts.",
- "keywords": [
- "kind",
- "tostring",
- "type",
- "typeof"
- ],
- "homepage": "https://github.com/moll/js-kindof",
- "bugs": "https://github.com/moll/js-kindof/issues",
-
- "author": {
- "name": "Andri Möll",
- "email": "andri@dot.ee",
- "url": "http://themoll.com"
- },
-
- "repository": {
- "type": "git",
- "url": "git://github.com/moll/js-kindof.git"
- },
-
- "licenses": [{
- "type": "LAGPL",
- "url": "https://github.com/moll/js-kindof/blob/master/LICENSE"
- }],
-
- "main": "kindof.js",
- "scripts": {"test": "make test"},
-
- "devDependencies": {
- "mocha": ">= 1.12.0 < 2"
- }
-}
diff --git a/kindof/test/index_test.js b/kindof/test/index_test.js
deleted file mode 100644
index 91183df..0000000
--- a/kindof/test/index_test.js
+++ /dev/null
@@ -1,206 +0,0 @@
-// Using assert instead of Must.js for safety because Must.js uses kindof.
-var assert = require("assert")
-var kindof = require("..")
-
-describe("kindof", function() {
- // Allow using Boolean, Number, String as constructors in tests.
- /* jshint -W053 */
-
- it("must return \"undefined\" for undefined", function() {
- assert.strictEqual(kindof(undefined), "undefined")
- })
-
- it("must return \"null\" for null", function() {
- assert.strictEqual(kindof(null), "null")
- })
-
- describe("given Boolean", function() {
- it("must return \"boolean\" for true", function() {
- assert.strictEqual(kindof(true), "boolean")
- })
-
- it("must return \"boolean\" for false", function() {
- assert.strictEqual(kindof(false), "boolean")
- })
-
- it("must return \"object\" for new Boolean(true)", function() {
- assert.strictEqual(kindof(new Boolean(true)), "object")
- })
-
- it("must return \"object\" for new Boolean(false)", function() {
- assert.strictEqual(kindof(new Boolean(false)), "object")
- })
-
- describe("given another context", function() {
- context("must return \"object\" for boolean object", function(window) {
- assert.strictEqual(kindof(new window.Boolean), "object")
- })
- })
- })
-
- describe("given Number", function() {
- it("must return \"number\" for number primitive", function() {
- assert.strictEqual(kindof(42), "number")
- })
-
- it("must return \"number\" for zero number primitive", function() {
- assert.strictEqual(kindof(0), "number")
- })
-
- it("must return \"object\" for number object", function() {
- assert.strictEqual(kindof(new Number(42)), "object")
- })
-
- it("must return \"object\" for zero number object", function() {
- assert.strictEqual(kindof(new Number(0)), "object")
- })
-
- it("must return \"number\" for NaN", function() {
- assert.strictEqual(kindof(NaN), "number")
- })
-
- it("must return \"number\" for Infinity", function() {
- assert.strictEqual(kindof(Infinity), "number")
- })
-
- describe("given another context", function() {
- context("must return \"object\" for number object", function(window) {
- assert.strictEqual(kindof(new window.Number), "object")
- })
- })
- })
-
- describe("given String", function() {
- it("must return \"string\" for string primitive", function() {
- assert.strictEqual(kindof("Hello"), "string")
- })
-
- it("must return \"string\" for empty string primitive", function() {
- assert.strictEqual(kindof(""), "string")
- })
-
- it("must return \"object\" for string object", function() {
- assert.strictEqual(kindof(new String("Hello")), "object")
- })
-
- it("must return \"object\" for empty string object", function() {
- assert.strictEqual(kindof(new String), "object")
- })
-
- describe("given another context", function() {
- context("must return \"object\" for string object", function(window) {
- assert.strictEqual(kindof(new window.String), "object")
- })
- })
- })
-
- if (typeof Symbol == "function") describe("given Symbol", function() {
- it("must return \"symbol\" for an anonymous symbol", function() {
- assert.strictEqual(kindof(Symbol()), "symbol")
- })
-
- it("must return \"symbol\" for a named symbol", function() {
- assert.strictEqual(kindof(Symbol("forEach")), "symbol")
- })
-
- it("must return \"symbol\" for an existing symbol", function() {
- assert.strictEqual(kindof(Symbol.iterator), "symbol")
- })
- })
-
- describe("given RegExp", function() {
- it("must return \"regexp\"", function() {
- assert.strictEqual(kindof(/./), "regexp")
- })
-
- describe("given another context", function() {
- context("must return \"regexp\"", function(window) {
- assert.strictEqual(kindof(new window.RegExp), "regexp")
- })
- })
- })
-
- describe("given Date", function() {
- it("must return \"date\"", function() {
- assert.strictEqual(kindof(new Date), "date")
- })
-
- describe("given another context", function() {
- context("must return \"date\"", function(window) {
- assert.strictEqual(kindof(new window.Date), "date")
- })
- })
- })
-
- describe("given Array", function() {
- it("must return \"array\"", function() {
- assert.strictEqual(kindof([]), "array")
- })
-
- describe("given another context", function() {
- context("must return \"array\"", function(window) {
- assert.strictEqual(kindof(new window.Array), "array")
- })
- })
- })
-
- describe("given Function", function() {
- it("must return \"function\"", function() {
- assert.strictEqual(kindof(function() {}), "function")
- })
-
- describe("given another context", function() {
- context("must return \"function\"", function(window) {
- assert.strictEqual(kindof(new window.Function), "function")
- })
- })
- })
-
- describe("given Error", function() {
- it("must return \"object\"", function() {
- assert.strictEqual(kindof(new Error), "object")
- })
- })
-
- describe("given Arguments", function() {
- it("must return \"object\"", function() {
- assert.strictEqual(kindof(arguments), "object")
- })
- })
-
- describe("given Math", function() {
- it("must return \"object\"", function() {
- assert.strictEqual(kindof(Math), "object")
- })
- })
-
- describe("given JSON", function() {
- it("must return \"object\"", function() {
- assert.strictEqual(kindof(JSON), "object")
- })
- })
-
- describe("given Object", function() {
- it("must return \"object\"", function() {
- assert.strictEqual(kindof({}), "object")
- })
- })
-
- describe("given custom instance", function() {
- it("must return \"object\"", function() {
- function Foo() {}
- assert.strictEqual(kindof(new Foo), "object")
- })
- })
-
- function context(title, fn) {
- if (typeof window == "undefined") return it.skip(title)
-
- it(title, function() {
- var frame = document.createElement("iframe")
- document.body.appendChild(frame)
- try { fn(frame.contentWindow) }
- finally { document.body.removeChild(frame) }
- })
- }
-})
diff --git a/kindof/test/mocha.opts b/kindof/test/mocha.opts
deleted file mode 100644
index 4a52320..0000000
--- a/kindof/test/mocha.opts
+++ /dev/null
@@ -1 +0,0 @@
---recursive
diff --git a/must/.editorconfig b/must/.editorconfig
deleted file mode 100644
index d65b494..0000000
--- a/must/.editorconfig
+++ /dev/null
@@ -1,11 +0,0 @@
-root = true
-
-[Makefile]
-indent_style = tab
-
-[*.js]
-indent_style = space
-indent_size = 2
-
-[*.json]
-indent_style = tab
diff --git a/must/.mailmap b/must/.mailmap
deleted file mode 100644
index fcc6121..0000000
--- a/must/.mailmap
+++ /dev/null
@@ -1 +0,0 @@
-Andri Möll <andri@dot.ee>
diff --git a/must/.npmignore b/must/.npmignore
deleted file mode 100644
index 383e57e..0000000
--- a/must/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/*.tgz
-/tmp/
-/.travis.yml
-/.mailmap
-/tags
diff --git a/must/CHANGELOG.md b/must/CHANGELOG.md
deleted file mode 100644
index 53dfdfe..0000000
--- a/must/CHANGELOG.md
+++ /dev/null
@@ -1,224 +0,0 @@
-## 0.13.4 (Jan 13, 2017)
-- Tweaks `Must.prototype.be` et al. implementation to prevent [`source-map-support`](https://github.com/evanw/node-source-map-support) from throwing an exception during call stack retrieval. This only happened if that module was used with Must.js for source map support.
-
-## 0.13.3 (Jan 12, 2017)
-- Adds a first draft of TypeScript definitions.
- Thanks, [Karl Purkhardt][@KarlPurk]!
-- Serialize `NaN`s in objects in error messages as `"[NaN]"`.
-
-[@KarlPurk]: https://github.com/KarlPurk
-
-## 0.13.2 (Jul 20, 2016)
-- Fixes stringifying `Symbol`s for assertion errors.
-- Stringifies `RegExp`s nested in objects for assertion errors.
-- Adds [`symbol`].
-- Adds [`properties`].
-- Adds [`ownProperties`].
-- Adds preliminary support for running under strict mode (`"use strict"`).
- Assertion error stack traces will contain one Must.js function at the top at the moment. This will be fixed!
-
-[`symbol`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.symbol
-[`properties`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.properties
-[`ownProperties`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.ownProperties
-
-## 0.13.1 (Sep 26, 2015)
-- Adds custom error message to
- [`Must`](https://github.com/moll/js-must/blob/master/doc/API.md#Must).
-
-## 0.13.0 (Sep 26, 2015)
-- Lucky version. No changes since the previous release candidate.
-
-## 0.13.0-rc1 (Sep 22, 2015)
-- Refactors [`eql`] to internally use
- [Egal.js](https://github.com/moll/js-egal), which was extracted from
- Must.js.
-
- Must.js augments `egal` to continue to allow you to assert equivalence to
- `NaN`s and instances of classes that aren't value objects. Egal.js doesn't
- compare those out of the box as they're not things you want to do in
- production code.
-
- With the transition to Egal.js, [`eql`] now also supports value objects that
- return compound values. See [Egal.js's
- README](https://github.com/moll/js-egal#value-objects) for details.
-
-## 0.13.0-beta2 (Jun 15, 2015)
-- Fixes the stack trace when using promises with some particular matchers.
-
-## 0.13.0-beta1 (Jun 15, 2015)
-- Adds [`must`] that returns self for those of us who sometimes write it twice:
-
- ```javascript
- demand(undefined).must.be.undefined()
- ```
-
-- Fixes a false positive in [`eql`][] when an object had some keys set to
- `undefined`.
-- Adds [`the`] for a fluent chain.
-- Changes [`boolean`] to not consider boxed boolean objects as booleans.
-- Changes [`number`] to not consider boxed number objects as numbers.
-- Changes [`string`] to not consider boxed string objects as strings.
-- Changes [`true`] and [`false`] to not consider boxed boolean objects as
- either true or false.
-
-- Adds [`resolve`] and [`reject`] for asserting on promises.
- The former is also aliased to [`then`] and [`eventually`] for different
- language styles.
-
- With [Mocha](http://mochajs.org), using this will look something like:
-
- ```javascript
- it("must pass", function() {
- return Promise.resolve(42).must.resolve.to.equal(42)
- })
- ```
-
- Using [CoMocha](https://github.com/blakeembrey/co-mocha), it'll look like:
- ```javascript
- it("must pass", function*() {
- yield Promise.resolve(42).must.resolve.to.equal(42)
- yield Promise.resolve(42).must.then.equal(42)
- yield Promise.reject(42).must.reject.and.equal(42)
- })
- ```
-
-- Adds [`with`] for a fluent chain.
-- Adds [`error`] to assert on errors.
- Similar to [`throw`], but useful for when you already have an error at hand.
-- Adds [`startWith`].
-- Adds [`endWith`].
-- Adds [`nan`] to test `NaN`.
-
-[`must`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.must
-[`the`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.the
-[`boolean`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.boolean
-[`number`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.number
-[`string`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.string
-[`true`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.true
-[`false`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.false
-[`resolve`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.resolve
-[`reject`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.reject
-[`then`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.then
-[`with`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.with
-[`error`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.error
-[`startWith`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.startWith
-[`endWith`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.endWith
-[`nan`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.nan
-
-## 0.12.0 (May 28, 2014)
-- Adds [`permutationOf`] to assert that two arrays contain the same elements.
- Thanks, [Miroslav Bajtoš][@bajtos]!
-
-[`permutationOf`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.permutationOf
-[@bajtos]: http://about.me/bajtos
-
-## 0.11.0 (Feb 13, 2014)
-- Works on other JavaScript engines besides V8 by not assuming
- `Error.captureStackTrace`. Thanks, [Dmitry Starostin][@incrop]!
-
-[@incrop]: https://github.com/incrop
-
-## 0.10.0 (Oct 31, 2013)
-- Allows asserting `NaN`s with [`eql`] — `NaN.must.eql(NaN)`.
-
-## 0.9.1 (Oct 31, 2013)
-- Fixes [`eql`] to consider two equivalent boxed `Boolean`, `Number` or `String`
- values *eql*.
- Previously it only did so if both were primitive (`42`) or only one was boxed
- (`new Number(42)`).
-
-## 0.9.0 (Oct 28, 2013)
-- Adds [`between`] to assert that a value is between a range.
-
-[`between`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.between
-
-## 0.8.0 (Oct 27, 2013)
-- Allows asserting and comparing circular and self-referential objects with
- [`eql`]. Objects that are self-referential in the exact same way are
- considered *eql*.
-- Displays circular and self-referential objects and arrays in assertion error
- messages properly.
-- Displays object's inherited properties in assertion error messages.
-
-## 0.7.0 (Oct 23, 2013)
-- Adds [`contain`] as an alias of [`include`].
-
-- Adds [`before`] as an alias of [`below`] to make comparing dates read more
- natural:
-
- ```javascript
- new Date(2000, 5, 18).must.be.before(new Date(2001, 0, 1))
- ```
-
-- Adds [`after`] as an alias of [`above`] to make comparing dates read more
- natural:
-
- ```javascript
- new Date(2030, 5, 18).must.be.after(new Date(2013, 9, 23))
- ```
-
-[`contain`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.contain
-[`include`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.include
-[`below`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.below
-[`before`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.before
-[`above`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.above
-[`after`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.after
-
-## 0.6.0 (Oct 15, 2013)
-- Allows asserting both the exception constructor and its message together in
- the [`throw`] matcher:
-
- ```javascript
- someFunction.must.throw(RangeError, /out of bounds/)
- ```
-
-[`throw`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.throw
-
-## 0.5.0 (Oct 13, 2013)
-- Sets the [`eql`] matcher's [`AssertionError`] diffable so some test
- runners would print out a property-by-property diff for mismatches. This helps
- visual comparison.
-
-[`AssertionError`]: https://github.com/moll/js-must/blob/master/doc/API.md#AssertionError
-
-## 0.4.0 (Oct 11, 2013)
-- Changes [`eql`] so it also compares instances of the same class recursively
- like it does with plain objects.
- If the instance has a `valueOf` function, however, its output is used as
- before.
-
-[`eql`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.eql
-
-## 0.3.0 (Oct 5, 2013)
-- Allows asserting [`property`] and [`ownProperty`] on all types (such as
- functions, booleans etc.), not only objects.
-- Allows asserting [`keys`] and [`ownKeys`] on all types (such as functions,
- booleans etc.), not only objects.
-- Allows asserting [`enumerable`] and [`nonenumerable`] properties on all
- types (such as functions, booleans etc.), not only objects.
-
-[`nonenumerable`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.nonenumerable
-[`ownProperty`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.ownProperty
-
-## 0.2.0 (Sep 26, 2013)
-- Fails gracefully if property matchers ([`property`],
- [`enumerable`] etc.) are used on non-objects.
-- Adds the [`keys`] matcher to test if an object has all
- the expected keys.
- Takes inherited keys into account just like the [`empty`] and [`property`]
- matchers.
-- Adds the [`ownKeys`] matcher to test if an object has all the expected keys
- of its own.
-
-[`empty`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.empty
-[`enumerable`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.enumerable
-[`property`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.property
-[`keys`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.keys
-[`ownKeys`]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.ownKeys
-
-## 0.1.338 (Sep 26, 2013)
-- Fixes Must.js's own tests on Windows thanks to [Bart van der Schoor][bartvds].
-[bartvds]: https://github.com/Bartvds
-
-## 0.1.337 (Sep 24, 2013)
-- First release. Must-have!
diff --git a/must/LICENSE b/must/LICENSE
deleted file mode 100644
index 1ac03e7..0000000
--- a/must/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Must.js
-Copyright (C) 2013 Andri Möll <andri@dot.ee>
-
-This program is free software: you can redistribute it and/or modify it under
-the terms of the GNU Affero General Public License as published by the Free
-Software Foundation, either version 3 of the License, or any later version.
-
-Additional permission under the GNU Affero GPL version 3 section 7:
-If you modify this Program, or any covered work, by linking or
-combining it with other code, such other code is not for that reason
-alone subject to any of the requirements of the GNU Affero GPL version 3.
-
-In summary:
-- You can use this program for no cost.
-- You can use this program for both personal and commercial reasons.
-- You do not have to share your own program's code which uses this program.
-- You have to share modifications (e.g bug-fixes) you've made to this program.
-
-For the full copy of the GNU Affero General Public License see:
-http://www.gnu.org/licenses.
diff --git a/must/Makefile b/must/Makefile
deleted file mode 100644
index 791a9e5..0000000
--- a/must/Makefile
+++ /dev/null
@@ -1,62 +0,0 @@
-NODE = node
-NODE_OPTS =
-TEST_OPTS =
-MOCUMENT = ~/Documents/Mocumentation/bin/mocument
-MOCUMENT_OPTS = --type yui --title Must.js
-
-love:
- @echo "Feel like makin' love."
-
-test:
- @$(NODE) $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS)
-
-spec:
- @$(NODE) $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS)
-
-autotest:
- @$(NODE) $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS)
-
-autospec:
- @$(NODE) $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS)
-
-pack:
- @file=$$(npm pack); echo "$$file"; tar tf "$$file"
-
-publish:
- npm publish
-
-publish-beta:
- npm publish --tag beta
-
-# NOTE: Sorry, mocumentation is not yet published.
-doc: doc.json
- @mkdir -p doc
- @$(MOCUMENT) $(MOCUMENT_OPTS) \
- --priority Must,Object \
- tmp/doc/data.json > doc/API.md
-
-toc: doc.json
- @$(MOCUMENT) $(MOCUMENT_OPTS) \
- --template toc \
- --include Must \
- --var api_url=https://github.com/moll/js-must/blob/master/doc/API.md \
- tmp/doc/data.json > tmp/TOC.md
-
- @echo '/^API$$/,/^Migrating/{/^API$$/{r tmp/TOC.md\na\\\n\\\n\\\n\n};/^Migrating/!d;}' |\
- sed -i "" -f /dev/stdin README.md
-
-doc.json:
- @mkdir -p tmp
- @yuidoc --exclude test,node_modules --parse-only --outdir tmp/doc .
-
-clean:
- rm -rf tmp *.tgz
-
-tag:
- git tag "v$$($(NODE) -e 'console.log(require("./package").version)')"
-
-.PHONY: love
-.PHONY: test spec autotest autospec
-.PHONY: pack publish clean
-.PHONY: doc toc doc.json
-.PHONY: tag
diff --git a/must/README.md b/must/README.md
deleted file mode 100644
index e61c656..0000000
--- a/must/README.md
+++ /dev/null
@@ -1,427 +0,0 @@
-Must.js
-=======
-[![NPM version][npm-badge]](https://www.npmjs.com/package/must)
-[![Build status][travis-badge]](https://travis-ci.org/moll/js-must)
-
-Must.js is a testing and assertion library for JavaScript and Node.js with
-a friendly **BDD** syntax (`awesome.must.be.true()`). It ships with **many
-expressive matchers** and is **test runner and framework agnostic**. Follows
-[RFC 2119][rfc2119] with its use of **MUST**. Good and well testsed stuff.
-
-For those new to testing JavaScript on Node.js, you'll also need a test
-framework (also called a test-runner or a harness) to run your tests. One such
-tool is [Mocha][mocha].
-
-[npm-badge]: https://img.shields.io/npm/v/must.svg
-[travis-badge]: https://travis-ci.org/moll/js-must.png?branch=master
-[rfc2119]: https://www.ietf.org/rfc/rfc2119.txt
-[mocha]: https://mochajs.org
-
-### Tour
-- Assert with a **beautiful and fluent chain** that saves you from wrapping
- objects manually and reads nicely, too:
- ```javascript
- require("must/register")
- obj.must.be.true()
- ```
-
-- Supports the **expect flavor** of wrapping as well:
- ```javascript
- var demand = require("must")
- demand(obj).be.string()
- ```
-
-- **Many expressive matchers** out of the box, including:
- ```javascript
- [].must.be.empty()
- obj.must.have.nonenumerable("foo")
- (42).must.be.above(13)
- ```
-
-- **Simple**, because **matchers always behave the same way** and don't depend
- on any "special flags" in the chain. They are also **not interdependent** the
- way `foo.should.have.property(x).with.lengthOf(5)` would be.
-
-- **Reasonable**, because it asserts only when you call the matcher
- `[].must.be.empty()` and not when you merely get the property `empty`. See
- below why [asserting on property access](#asserting-on-property-access) is
- **dangerous** in other assertion libraries.
-
-- Has an **intelligent and type-safe** recursive [`eql`][Must.prototype.eql]
- matcher that compares arrays and objects by content and supports value
- objects. It's fully type-safe, so instances of *different classes* aren't
- *eql*, even if their properties are. It also supports **circular and
- self-referential** objects.
- ```javascript
- primesBelowTen.must.eql([2, 3, 5, 7])
- model.attributes.must.eql({title: "New", createdAt: new Date(2000, 1, 1)})
- ```
-
-- Built-in support for **asserting on promises** with stack traces leading back
- to _your_ assertion, not to the library's internals.
-
- ```javascript
- Promise.resolve(42).must.then.equal(42)
- Promise.resolve([1, 2, 3]).must.eventually.not.include(42)
- Promise.reject(new Error("Problemo")).must.reject.with.error(/problem/i)
- ```
-
-- **Human readable error messages** let you know if an object wasn't what you
- expected. You can also customize or prepend to the autogenerated error
- message for further clarification.
-
-- Honors [RFC 2119][rfc2119] by using the word **MUST** because your
- tests assert things, they don't list wishes or prayers, right? Exactly!
- `Foo.must.equal(42)`, not `foo.pretty.please.equal(42)`.
-
-- Works with any test runner and framework.
-- Avoids type coercions and mismatches.
-- Well tested — over 700 cases in over 2500 lines of tests. That makes a test to
- code ratio of 5:1.
-
-### Using Should.js or Chai.js? Switch for safety!
-Among other things, one reason why [Should.js][should.js] and [Chai.js][chai.js]
-inspired me to write Must.js is that they have a **fundamental design mistake**
-that makes them both **surprising in a bad way** and **dangerous to use**. [Read
-more below](#asserting-on-property-access).
-
-### Extensible
-
-Must.js features a very simple implementation and one you can extend yourself. In Must.js, every matcher is a function on `Must.prototype` that calls `Must.prototype.assert`. For now, please see the source of Must for examples.
-
-There are [plugins for Must.js](#plugins) by others available, too.
-
-
-Installing
-----------
-**Note**: Must.js will follow the [semantic versioning](http://semver.org/)
-starting from v1.0.0.
-
-### Installing on Node.js
-```
-npm install must
-```
-
-### Installing for the browser
-Must.js doesn't yet have a build ready for the browser, but you might be able
-to use [Browserify][browserify] to have it run there till then.
-
-[browserify]: https://github.com/substack/node-browserify
-
-
-Using
------
-To use the **fluent chain**, just require Must.js's "register" file and it'll
-make itself available everywhere:
-```javascript
-require("must/register")
-```
-
-Then just access the `must` property on any object and call matchers on it.
-```javascript
-answer.must.equal(42)
-new Date().must.be.an.instanceof(Date)
-```
-
-If you wish to use the **expect flavor**, assign Must to any name of your
-choice, e.g:
-```javascript
-var expect = require("must")
-var demand = require("must")
-```
-
-And call it with the object you wish to assert:
-```javascript
-expect(answer).to.equal(42)
-demand(null).be.null()
-```
-
-For a list of all matchers, please see the [Must.js API Documentation][api].
-
-### Negative asserting or matching the opposite
-To assert the opposite, just add `not` between the chain:
-```javascript
-true.must.not.be.false()
-[].must.not.be.empty()
-```
-
-Use it multiple times to create lots of fun puzzles! :-)
-```javascript
-true.must.not.not.be.true()
-```
-
-### Asserting on null and undefined values
-In almost all cases you can freely call methods on any object in JavaScript.
-Except for `null` and `undefined`.
-
-Most of the time this won't be a problem, because if you're asserting that
-`something.must.be.true()` and `something` ends up `null`, the test will still
-fail. If, however, you do need to assert its nullness, aliasing Must to `expect`
-or `demand` and wrapping it manually works well:
-
-```javascript
-var demand = require("must")
-demand(something).be.null()
-demand(undefined).be.undefined()
-```
-
-If you've got an object on which a `null` or an `undefined` property must
-_exist_ in addition to having a nully value, use the
-[`property`][Must.prototype.property] matcher:
-
-```javascript
-var obj = {id: null, name: undefined}
-obj.must.have.property("id", null)
-obj.must.have.property("name", undefined)
-```
-
-### Autoloading
-If your test runner supports an options file, you might want to require Must
-there so you wouldn't have to remember to `require` in each test file.
-
-For [Mocha][mocha], that file is `test/mocha.opts`:
-```
---require must/register
-```
-
-### Full example
-Inside a test runner or framework things would look something like this:
-```javascript
-require("must/register")
-var MySong = require("../my_song")
-
-describe("MySong", function() {
- it("must be creatable", function() {
- new MySong().must.be.an.instanceof(MySong)
- })
-
- it("must have cowbell", function() {
- new MySong().cowbell.must.be.true()
- })
-
- it("must not have pop", function() {
- new MySong().must.not.have.property("pop")
- })
-})
-```
-
-
-API
----
-For extended documentation on all functions, please see the
-[Must.js API Documentation][api].
-
-[api]: https://github.com/moll/js-must/blob/master/doc/API.md
-
-### [Must](https://github.com/moll/js-must/blob/master/doc/API.md#Must)
-- [.prototype.a](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.a)(class)
-- [.prototype.above](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.above)(expected)
-- [.prototype.after](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.after)(expected)
-- [.prototype.an](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.an)(class)
-- [.prototype.array](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.array)()
-- [.prototype.at](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.at)
-- [.prototype.be](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.be)(expected)
-- [.prototype.before](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.before)(expected)
-- [.prototype.below](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.below)(expected)
-- [.prototype.between](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.between)(begin, end)
-- [.prototype.boolean](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.boolean)()
-- [.prototype.contain](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.contain)(expected)
-- [.prototype.date](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.date)()
-- [.prototype.empty](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.empty)()
-- [.prototype.endWith](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.endWith)(expected)
-- [.prototype.enumerable](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.enumerable)(property)
-- [.prototype.enumerableProperty](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.enumerableProperty)(property)
-- [.prototype.eql](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.eql)(expected)
-- [.prototype.equal](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.equal)(expected)
-- [.prototype.error](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.error)([constructor], [expected])
-- [.prototype.eventually](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.eventually)
-- [.prototype.exist](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.exist)()
-- [.prototype.false](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.false)()
-- [.prototype.falsy](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.falsy)()
-- [.prototype.frozen](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.frozen)()
-- [.prototype.function](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.function)()
-- [.prototype.gt](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.gt)(expected)
-- [.prototype.gte](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.gte)(expected)
-- [.prototype.have](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.have)
-- [.prototype.include](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.include)(expected)
-- [.prototype.instanceOf](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.instanceOf)(class)
-- [.prototype.instanceof](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.instanceof)(class)
-- [.prototype.is](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.is)(expected)
-- [.prototype.keys](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.keys)(keys)
-- [.prototype.least](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.least)(expected)
-- [.prototype.length](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.length)(expected)
-- [.prototype.lt](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.lt)(expected)
-- [.prototype.lte](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.lte)(expected)
-- [.prototype.match](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.match)(regexp)
-- [.prototype.most](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.most)(expected)
-- [.prototype.must](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.must)
-- [.prototype.nan](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.nan)()
-- [.prototype.nonenumerable](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.nonenumerable)(property)
-- [.prototype.nonenumerableProperty](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.nonenumerableProperty)(property)
-- [.prototype.not](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.not)
-- [.prototype.null](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.null)()
-- [.prototype.number](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.number)()
-- [.prototype.object](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.object)()
-- [.prototype.own](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.own)(property, [value])
-- [.prototype.ownKeys](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.ownKeys)(keys)
-- [.prototype.ownProperties](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.ownProperties)(properties)
-- [.prototype.ownProperty](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.ownProperty)(property, [value])
-- [.prototype.permutationOf](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.permutationOf)(expected)
-- [.prototype.properties](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.properties)(properties)
-- [.prototype.property](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.property)(property, [value])
-- [.prototype.regexp](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.regexp)()
-- [.prototype.reject](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.reject)
-- [.prototype.resolve](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.resolve)
-- [.prototype.startWith](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.startWith)(expected)
-- [.prototype.string](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.string)()
-- [.prototype.symbol](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.symbol)()
-- [.prototype.the](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.the)
-- [.prototype.then](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.then)
-- [.prototype.throw](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.throw)([constructor], [expected])
-- [.prototype.to](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.to)
-- [.prototype.true](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.true)()
-- [.prototype.truthy](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.truthy)()
-- [.prototype.undefined](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.undefined)()
-- [.prototype.with](https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.with)
-
-
-Migrating to Must.js
---------------------
-You're likely to be already using some testing library and have a set of tests
-in them. I'm **honored you picked** Must.js to go forward. Let's **get you up to
-speed** on how Must.js differs from others and how to **migrate your old tests**
-over.
-
-### From Should.js
-Must.js and [Should.js][should.js] are fairly similar when it comes to matchers.
-
-- Just add parentheses after each assertion and you're almost set.
-- Must.js does not have static matchers like `should.not.exist(obj.foo)`.
- Convert to `demand(foo).not.to.exist()`.
-- Must.js lacks `with.lengthOf` because its matchers are all independent.
- Convert to `obj.must.have.length(5)`
-- Must.js lacks the `ok` matcher because unambiguous names are better.
- Convert to `truthy`.
-- Must.js does not support custom error descriptions.
-
-Here's a quick `sed` script to convert `obj.should.xxx` style to
-`obj.must.xxx()`:
-```
-sed -i.should -E -f /dev/stdin test/**/*.js <<-end
- /\.should\.([[:alpha:].]+)([[:space:]}\);]|$)/s/\.should\.([[:alpha:].]+)/.must.\1()/g
- s/\.should\.([[:alpha:].]+)/.must.\1/g
-end
-```
-
-### From Chai.js
-Must.js and [Chai.js][chai.js] are fairly similar when it comes to matchers.
-
-- Just add parentheses after each assertion and you're almost set.
- That goes for both the BDD (`obj.should`) and *expect*
- (`expect(obj).to`) flavor.
-- Must.js lacks the `include` flag because its matchers are all independent.
- Convert to `Object.keys(obj).must.include("foo")`.
-- Must.js lacks the `deep` flag for the `equal` matcher because
- [`eql`][Must.prototype.eql] already compares recursively and in a type-safe
- way.
- Convert to `obj.must.eql({some: {deep: "object"}})`.
-- Must.js lacks the `deep` flag for the `property` matcher because it prefers
- regular property access.
- Convert to `obj.some.nested.property.must.equal(42)`.
-- Must.js lacks the `ok` matcher because unambiguous names are better.
- Convert to `truthy`.
-- Must.js lacks the `respondTo` matcher because unambiguous names are better.
- Convert to `MyClass.prototype.must.be.a.function()`.
-
-Here's a quick `sed` script to convert `obj.should.xxx` style to
-`obj.must.xxx()`:
-```
-sed -i.should -E -f /dev/stdin test/**/*.js <<-end
- /\.should\.([[:alpha:].]+)([[:space:]}\);]|$)/s/\.should\.([[:alpha:].]+)/.must.\1()/g
- s/\.should\.([[:alpha:].]+)/.must.\1/g
-end
-```
-
-### Convert test case titles to MUST
-If you've used the `should` style before, you most likely have test cases titled
-`it("should do good")`.
-Migrate those to `it("must do good")` with this `sed` script:
-```
-sed -i.should -E -e 's/it\("should/it("must/g' test/**/*.js
-```
-
-<a name="asserting-on-property-access"></a>
-### Beware of libraries that assert on property access
-Among other things, one reason why [Should.js][should.js] and
-[Chai.js][chai.js] inspired me to write Must.js is that they have
-a **fundamental design mistake** that makes them both **surprising in a bad
-way** and **dangerous to use**.
-
-It has to do with them asserting on property access, like this:
-```javascript
-true.should.be.true
-[].should.be.empty
-```
-
-What initially may seem familiar to Ruby programmers, first of all, is out of
-place in JavaScript. Dot-something stands for getting a property's value and
-getters, regardless of language, **should not** have **side-effects**.
-Especially not **control-flow changing exceptions**!
-
-Secondly, and this is where it's flat out **dangerous asserting on property
-access**, is that accessing a non-existent property does **nothing** in
-JavaScript. Recall that JavaScript does not have Ruby's `method_missing` or
-other hooks to catch such access. So, guess what happens when someone mistypes
-or mis-remembers a matcher? Yep, nothin' again. And that's the way it's supposed
-to be. But what's good in JavaScript, **not so good** for your now **false
-positive test**.
-
-Imagine using a plugin that adds matchers for spies or mocks. Then using it with
-`someFn.should.have.been.calledOnce`. Someone accidentally removes the plugin
-or thinks `calledQuadrice` sounds good? Well, those assertions will surely
-continue passing because they'll now just get `undefined` back.
-
-Must.js **solves both problems** with the **simplest but effective solution**
-— requires you to **always call matchers** because they're plain-old functions
-— `expect(problem).to.not.exist()`.
-
-[should.js]: https://github.com/visionmedia/should.js
-[chai.js]: http://chaijs.com
-
-
-Plugins
--------
-- [must-sinon](https://www.npmjs.com/package/must-sinon) ([Repository](https://github.com/JohnnyEstilles/must-sinon)) — Sinon assertions.
-- [must-targaryen](https://www.npmjs.com/package/must-targaryen) ([Repository](https://github.com/jtwebman/must-targaryen)) — Firebase Targaryen assertions.
-- [must-jsx](https://www.npmjs.com/package/must-jsx) ([Repository](https://github.com/nwinch/must-jsx)] — React.js JSX assertions.
-
-If you have a module extending Must.js one not listed above, please let me know or create a pull request.
-
-
-License
--------
-Must.js is released under a *Lesser GNU Affero General Public License*, which in
-summary means:
-
-- You **can** use this program for **no cost**.
-- You **can** use this program for **both personal and commercial reasons**.
-- You **do not have to share your own program's code** which uses this program.
-- You **have to share modifications** (e.g bug-fixes) you've made to this
- program.
-
-For more convoluted language, see the `LICENSE` file.
-
-
-About
------
-**[Andri Möll](http://themoll.com)** typed this and the code.
-[Monday Calendar](https://mondayapp.com) supported the engineering work.
-
-If you find Must.js needs improving, please don't hesitate to type to me now at
-[andri@dot.ee][email] or [create an issue online][issues].
-
-[email]: mailto:andri@dot.ee
-[issues]: https://github.com/moll/js-must/issues
-
-[Must.prototype.eql]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.eql
-[Must.prototype.property]: https://github.com/moll/js-must/blob/master/doc/API.md#Must.prototype.property
diff --git a/must/doc/API.md b/must/doc/API.md
deleted file mode 100644
index bf0f9e7..0000000
--- a/must/doc/API.md
+++ /dev/null
@@ -1,1012 +0,0 @@
-Must.js API Documentation
-=========================
-### [Must](#Must)
-- [.prototype.a](#Must.prototype.a)(class)
-- [.prototype.above](#Must.prototype.above)(expected)
-- [.prototype.after](#Must.prototype.after)(expected)
-- [.prototype.an](#Must.prototype.an)(class)
-- [.prototype.array](#Must.prototype.array)()
-- [.prototype.at](#Must.prototype.at)
-- [.prototype.be](#Must.prototype.be)(expected)
-- [.prototype.before](#Must.prototype.before)(expected)
-- [.prototype.below](#Must.prototype.below)(expected)
-- [.prototype.between](#Must.prototype.between)(begin, end)
-- [.prototype.boolean](#Must.prototype.boolean)()
-- [.prototype.contain](#Must.prototype.contain)(expected)
-- [.prototype.date](#Must.prototype.date)()
-- [.prototype.empty](#Must.prototype.empty)()
-- [.prototype.endWith](#Must.prototype.endWith)(expected)
-- [.prototype.enumerable](#Must.prototype.enumerable)(property)
-- [.prototype.enumerableProperty](#Must.prototype.enumerableProperty)(property)
-- [.prototype.eql](#Must.prototype.eql)(expected)
-- [.prototype.equal](#Must.prototype.equal)(expected)
-- [.prototype.error](#Must.prototype.error)([constructor], [expected])
-- [.prototype.eventually](#Must.prototype.eventually)
-- [.prototype.exist](#Must.prototype.exist)()
-- [.prototype.false](#Must.prototype.false)()
-- [.prototype.falsy](#Must.prototype.falsy)()
-- [.prototype.frozen](#Must.prototype.frozen)()
-- [.prototype.function](#Must.prototype.function)()
-- [.prototype.gt](#Must.prototype.gt)(expected)
-- [.prototype.gte](#Must.prototype.gte)(expected)
-- [.prototype.have](#Must.prototype.have)
-- [.prototype.include](#Must.prototype.include)(expected)
-- [.prototype.instanceOf](#Must.prototype.instanceOf)(class)
-- [.prototype.instanceof](#Must.prototype.instanceof)(class)
-- [.prototype.is](#Must.prototype.is)(expected)
-- [.prototype.keys](#Must.prototype.keys)(keys)
-- [.prototype.least](#Must.prototype.least)(expected)
-- [.prototype.length](#Must.prototype.length)(expected)
-- [.prototype.lt](#Must.prototype.lt)(expected)
-- [.prototype.lte](#Must.prototype.lte)(expected)
-- [.prototype.match](#Must.prototype.match)(regexp)
-- [.prototype.most](#Must.prototype.most)(expected)
-- [.prototype.must](#Must.prototype.must)
-- [.prototype.nan](#Must.prototype.nan)()
-- [.prototype.nonenumerable](#Must.prototype.nonenumerable)(property)
-- [.prototype.nonenumerableProperty](#Must.prototype.nonenumerableProperty)(property)
-- [.prototype.not](#Must.prototype.not)
-- [.prototype.null](#Must.prototype.null)()
-- [.prototype.number](#Must.prototype.number)()
-- [.prototype.object](#Must.prototype.object)()
-- [.prototype.own](#Must.prototype.own)(property, [value])
-- [.prototype.ownKeys](#Must.prototype.ownKeys)(keys)
-- [.prototype.ownProperties](#Must.prototype.ownProperties)(properties)
-- [.prototype.ownProperty](#Must.prototype.ownProperty)(property, [value])
-- [.prototype.permutationOf](#Must.prototype.permutationOf)(expected)
-- [.prototype.properties](#Must.prototype.properties)(properties)
-- [.prototype.property](#Must.prototype.property)(property, [value])
-- [.prototype.regexp](#Must.prototype.regexp)()
-- [.prototype.reject](#Must.prototype.reject)
-- [.prototype.resolve](#Must.prototype.resolve)
-- [.prototype.startWith](#Must.prototype.startWith)(expected)
-- [.prototype.string](#Must.prototype.string)()
-- [.prototype.symbol](#Must.prototype.symbol)()
-- [.prototype.the](#Must.prototype.the)
-- [.prototype.then](#Must.prototype.then)
-- [.prototype.throw](#Must.prototype.throw)([constructor], [expected])
-- [.prototype.to](#Must.prototype.to)
-- [.prototype.true](#Must.prototype.true)()
-- [.prototype.truthy](#Must.prototype.truthy)()
-- [.prototype.undefined](#Must.prototype.undefined)()
-- [.prototype.with](#Must.prototype.with)
-
-### [Object](#Object)
-- [.prototype.must](#Object.prototype.must)
-
-### [AssertionError](#AssertionError)
-- [actual](#assertionError.actual)
-- [diffable](#assertionError.diffable)
-- [expected](#assertionError.expected)
-- [showDiff](#assertionError.showDiff)
-- [stack](#assertionError.stack)
-
-
-<a name="Must" />
-Must(actual, [message])
------------------------
-The main class that wraps the asserted object and that you call matchers on.
-
-To include a custom error message for failure cases, pass a string as the
-second argument.
-
-Most of the time you'll be using
-[`Object.prototype.must`](#Object.prototype.must) to create this wrapper, but
-occasionally you might want to assert `null`s or `undefined`s and in those
-cases assigning `Must` to something like `expect` or `demand` works nicely.
-
-**Examples**:
-```javascript
-true.must.be.true()
-[].must.be.empty()
-
-var expect = require("must")
-expect(null).to.be.null()
-
-var demand = require("must")
-demand(undefined, "The undefined undefineds").be.undefined()
-```
-
-<a name="Must.prototype.a" />
-### Must.prototype.a(class)
-Alias of [`instanceof`](#Must.prototype.instanceof).
-Can also be used a pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-"Hello".must.be.a.string()
-new Date().must.be.a(Date)
-```
-
-<a name="Must.prototype.above" />
-### Must.prototype.above(expected)
-Assert that an object is above and greater than (`>`) `expected`.
-Uses `>` for comparison, so it'll also work with value objects (those
-implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
-
-**Examples**:
-```javascript
-(69).must.be.above(42)
-```
-
-<a name="Must.prototype.after" />
-### Must.prototype.after(expected)
-Alias of [`above`](#Must.prototype.above).
-Works well with dates where saying *after* is more natural than *above* or
-*greater than*.
-
-To assert that a date is equivalent to another date, use
-[`eql`](#Must.prototype.eql). For regular numbers,
-[`equal`](#Must.prototype.equal) is fine.
-
-**Examples**:
-```javascript
-(1337).must.be.after(42)
-new Date(2030, 5, 18).must.be.after(new Date(2013, 9, 23))
-```
-
-<a name="Must.prototype.an" />
-### Must.prototype.an(class)
-Alias of [`instanceof`](#Must.prototype.instanceof).
-Can also be used a pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-[1, 2].must.be.an.array()
-new AwesomeClass().must.be.an(AwesomeClass)
-```
-
-<a name="Must.prototype.array" />
-### Must.prototype.array()
-Assert object is an array.
-
-**Examples**:
-```javascript
-[42, 69].must.be.an.array()
-```
-
-<a name="Must.prototype.at" />
-### Must.prototype.at
-Pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-(42).must.be.at.most(69)
-(1337).must.be.at.least(1337)
-```
-
-<a name="Must.prototype.be" />
-### Must.prototype.be(expected)
-Alias of [`equal`](#Must.prototype.equal).
-Can also be used as a pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-true.must.be.true()
-(42).must.be(42)
-```
-
-<a name="Must.prototype.before" />
-### Must.prototype.before(expected)
-Alias of [`below`](#Must.prototype.below).
-Works well with dates where saying *before* is more natural than *below* or
-*less than*.
-
-To assert that a date is equivalent to another date, use
-[`eql`](#Must.prototype.eql). For regular numbers,
-[`equal`](#Must.prototype.equal) is fine.
-
-**Examples**:
-```javascript
-(42).must.be.before(1337)
-new Date(2000, 5, 18).must.be.before(new Date(2001, 0, 1))
-```
-
-<a name="Must.prototype.below" />
-### Must.prototype.below(expected)
-Assert that an object is below and less than (`<`) `expected`.
-Uses `<` for comparison, so it'll also work with value objects (those
-implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
-
-**Examples**:
-```javascript
-(42).must.be.below(69)
-```
-
-<a name="Must.prototype.between" />
-### Must.prototype.between(begin, end)
-Assert that an object is between `begin` and `end` (inclusive).
-Uses `<` for comparison, so it'll also work with value objects (those
-implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
-
-**Examples**:
-```javascript
-(13).must.be.between(13, 69)
-(42).must.be.between(13, 69)
-(69).must.be.between(13, 69)
-```
-
-<a name="Must.prototype.boolean" />
-### Must.prototype.boolean()
-Assert object is a boolean (`true` or `false`).
-Boxed boolean objects (`new Boolean`) are _not_ considered booleans.
-
-**Examples**:
-```javascript
-true.must.be.a.boolean()
-```
-
-<a name="Must.prototype.contain" />
-### Must.prototype.contain(expected)
-Alias of [`include`](#Must.prototype.include).
-
-<a name="Must.prototype.date" />
-### Must.prototype.date()
-Assert object is a date.
-
-**Examples**:
-```javascript
-new Date().must.be.a.date()
-```
-
-<a name="Must.prototype.empty" />
-### Must.prototype.empty()
-Assert that an object is empty.
-Checks either the `length` for arrays and strings or the count of
-enumerable keys. Inherited keys also counted.
-
-**Examples**:
-```javascript
-"".must.be.empty()
-[].must.be.empty()
-({}).must.be.empty()
-```
-
-<a name="Must.prototype.endWith" />
-### Must.prototype.endWith(expected)
-Assert a string ends with the given string.
-
-**Examples**:
-```javascript
-"Hello, John".must.endWith("John")
-```
-
-<a name="Must.prototype.enumerable" />
-### Must.prototype.enumerable(property)
-Assert that an object has an enumerable property `property`.
-It will fail if the object lacks the property entirely.
-
-This also checks inherited properties in the prototype chain, something which
-`Object.prototype.propertyIsEnumerable` itself does not do.
-
-For checking if a property exists *and* is non-enumerable, see
-[`nonenumerable`](#Must.prototype.nonenumerable).
-
-**Examples**:
-```javascript
-({life: 42, love: 69}).must.have.enumerable("love")
-```
-
-<a name="Must.prototype.enumerableProperty" />
-### Must.prototype.enumerableProperty(property)
-Alias of [`enumerable`](#Must.prototype.enumerable).
-
-<a name="Must.prototype.eql" />
-### Must.prototype.eql(expected)
-Assert object equality by content and if possible, recursively.
-Also handles circular and self-referential objects.
-
-For most parts it asserts strict equality (`===`), but:
-- `RegExp` objects are compared by their pattern and flags.
-- `Date` objects are compared by their value.
-- `Array` objects are compared recursively.
-- `NaN`s are considered equivalent.
-- Instances of the same class with a `valueOf` function are compared by its
- output.
-- Plain objects and instances of the same class are compared recursively.
-
-**Does not coerce types** so **mismatching types fail**.
-Inherited enumerable properties are also taken into account.
-
-**Instances** are objects whose prototype's `constructor` property is set.
-E.g. `new MyClass`.
-Others, like `{}` or `Object.create({})`, are **plain objects**.
-
-**Examples**:
-```javascript
-/[a-z]/.must.eql(/[a-z]/)
-new Date(1987, 5, 18).must.eql(new Date(1987, 5, 18))
-["Lisp", 42].must.eql(["Lisp", 42])
-({life: 42, love: 69}).must.eql({life: 42, love: 69})
-NaN.must.eql(NaN)
-
-function Answer(answer) { this.answer = answer }
-new Answer(42).must.eql(new Answer(42))
-```
-
-<a name="Must.prototype.equal" />
-### Must.prototype.equal(expected)
-Assert object strict equality or identity (`===`).
-
-To compare value objects (like `Date` or `RegExp`) by their value rather
-than identity, use [`eql`](#Must.prototype.eql).
-To compare arrays and objects by content, also use
-[`eql`](#Must.prototype.eql).
-
-**Examples**:
-```javascript
-(42).must.equal(42)
-
-var date = new Date
-date.must.equal(date)
-```
-
-<a name="Must.prototype.error" />
-### Must.prototype.error([constructor], [expected])
-Assert that an object is an error (instance of `Error` by default).
-Optionally assert it matches `expected` (and/or is of instance
-`constructor`).
-When you have a function that's supposed to throw, use
-[`throw`](#Must.prototype.throw).
-
-Given `expected`, the error is asserted as follows:
-- A **string** is compared with the exception's `message` property.
-- A **regular expression** is matched against the exception's `message`
- property.
-- A **function** (a.k.a. constructor) is used to check if the error
- is an `instanceof` that constructor.
-- All other cases of `expected` are left unspecified for now.
-
-**Examples**:
-```javascript
-var err = throw new RangeError("Everything's amazing and nobody's happy") }
-err.must.be.an.error()
-err.must.be.an.error("Everything's amazing and nobody's happy")
-err.must.be.an.error(/amazing/)
-err.must.be.an.error(Error)
-err.must.be.an.error(RangeError)
-err.must.be.an.error(RangeError, "Everything's amazing and nobody's happy")
-err.must.be.an.error(RangeError, /amazing/)
-```
-
-<a name="Must.prototype.eventually" />
-### Must.prototype.eventually
-Alias of [`resolve`](#Must.prototype.resolve).
-
-**Examples**:
-```javascript
-Promise.resolve(42).must.eventually.equal(42)
-```
-
-<a name="Must.prototype.exist" />
-### Must.prototype.exist()
-Assert object is exists and thereby is not null or undefined.
-
-**Examples**:
-```javascript
-0.must.exist()
-"".must.exist()
-({}).must.exist()
-```
-
-<a name="Must.prototype.false" />
-### Must.prototype.false()
-Assert object is `false`.
-A boxed boolean object (`new Boolean(false`) is _not_ considered false.
-
-**Examples**:
-```javascript
-false.must.be.false()
-```
-
-<a name="Must.prototype.falsy" />
-### Must.prototype.falsy()
-Assert object is falsy (`!obj`).
-
-Only `null`, `undefined`, `0`, `false` and `""` are falsy in JavaScript.
-Everything else is truthy.
-
-**Examples**:
-```javascript
-0.must.be.falsy()
-"".must.be.falsy()
-```
-
-<a name="Must.prototype.frozen" />
-### Must.prototype.frozen()
-Assert that an object is frozen with `Object.isFrozen`.
-
-**Examples**:
-```javascript
-Object.freeze({}).must.be.frozen()
-```
-
-<a name="Must.prototype.function" />
-### Must.prototype.function()
-Assert object is a function.
-
-**Examples**:
-```javascript
-(function() {}).must.be.a.function()
-```
-
-<a name="Must.prototype.gt" />
-### Must.prototype.gt(expected)
-Alias of [`above`](#Must.prototype.above).
-
-<a name="Must.prototype.gte" />
-### Must.prototype.gte(expected)
-Alias of [`least`](#Must.prototype.least).
-
-<a name="Must.prototype.have" />
-### Must.prototype.have
-Pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-[1, 2].must.have.length(2)
-```
-
-<a name="Must.prototype.include" />
-### Must.prototype.include(expected)
-Assert object includes `expected`.
-
-For strings it checks the text, for arrays it checks elements and for
-objects the property values. Everything is checked with strict equals
-(`===`).
-
-**Examples**:
-```javascript
-"Hello, John!".must.include("John")
-[1, 42, 3].must.include(42)
-({life: 42, love: 69}).must.include(42)
-```
-
-<a name="Must.prototype.instanceOf" />
-### Must.prototype.instanceOf(class)
-Alias of [`instanceof`](#Must.prototype.instanceof).
-
-<a name="Must.prototype.instanceof" />
-### Must.prototype.instanceof(class)
-Assert that an object is an instance of something.
-Uses `obj instanceof expected`.
-
-**Examples**:
-```javascript
-new Date().must.be.an.instanceof(Date)
-```
-
-<a name="Must.prototype.is" />
-### Must.prototype.is(expected)
-Alias of [`equal`](#Must.prototype.equal).
-Can also be used as a pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-var claim = require("must")
-claim(true).is.true()
-claim(42).is(42)
-```
-
-<a name="Must.prototype.keys" />
-### Must.prototype.keys(keys)
-Assert that an object has only the expected enumerable `keys`.
-Pass an array of strings as `keys`.
-
-Takes **inherited properties** into account. To not do so, see
-[`ownKeys`](#Must.prototype.ownKeys).
-
-**Examples**:
-```javascript
-({life: 42, love: 69}).must.have.keys(["life", "love"])
-Object.create({life: 42}).must.have.keys(["life"])
-```
-
-<a name="Must.prototype.least" />
-### Must.prototype.least(expected)
-Assert that an object is at least, greater than or equal to (`>=`),
-`expected`.
-Uses `>=` for comparison, so it'll also work with value objects (those
-implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
-
-**Examples**:
-```javascript
-(69).must.be.at.least(42)
-(42).must.be.at.least(42)
-```
-
-<a name="Must.prototype.length" />
-### Must.prototype.length(expected)
-Assert that an object has a length property equal to `expected`.
-
-**Examples**:
-```javascript
-"Something or other".must.have.length(18)
-[1, 2, 3, "Four o'clock rock"].must.have.length(4)
-```
-
-<a name="Must.prototype.lt" />
-### Must.prototype.lt(expected)
-Alias of [`below`](#Must.prototype.below).
-
-<a name="Must.prototype.lte" />
-### Must.prototype.lte(expected)
-Alias of [`most`](#Must.prototype.most).
-
-<a name="Must.prototype.match" />
-### Must.prototype.match(regexp)
-Assert object matches the given regular expression.
-
-If you pass in a non regular expression object, it'll be converted to one
-via `new RegExp(regexp)`.
-
-**Examples**:
-```javascript
-"Hello, John!".must.match(/john/i)
-"Wei wu wei".must.match("wu")
-```
-
-<a name="Must.prototype.most" />
-### Must.prototype.most(expected)
-Assert that an object is at most, less than or equal to (`<=`), `expected`.
-Uses `<=` for comparison, so it'll also work with value objects (those
-implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
-
-**Examples**:
-```javascript
-(42).must.be.at.most(69)
-(42).must.be.at.most(42)
-```
-
-<a name="Must.prototype.must" />
-### Must.prototype.must
-Pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-(42).must.must.must.must.equal(42)
-```
-
-<a name="Must.prototype.nan" />
-### Must.prototype.nan()
-Assert object is `NaN`.
-
-**Examples**:
-```javascript
-NaN.must.be.nan()
-```
-
-<a name="Must.prototype.nonenumerable" />
-### Must.prototype.nonenumerable(property)
-Assert that an object has a non-enumerable property `property`.
-It will fail if the object lacks the property entirely.
-
-This also checks inherited properties in the prototype chain, something which
-`Object.prototype.propertyIsEnumerable` itself does not do.
-
-It's the inverse of [`enumerable`](#Must.prototype.enumerable).
-
-**Examples**:
-```javascript
-(function() {}).must.have.nonenumerable("call")
-Object.create({}, {love: {enumerable: 0}}).must.have.nonenumerable("love")
-```
-
-<a name="Must.prototype.nonenumerableProperty" />
-### Must.prototype.nonenumerableProperty(property)
-Alias of [`nonenumerable`](#Must.prototype.nonenumerable).
-
-<a name="Must.prototype.not" />
-### Must.prototype.not
-Inverse the assertion.
-Use it multiple times to create lots of fun!
-`true.must.not.not.be.true()` :-)
-
-**Examples**:
-```javascript
-true.must.not.be.true()
-[].must.not.be.empty()
-```
-
-<a name="Must.prototype.null" />
-### Must.prototype.null()
-Assert object is `null`.
-
-Because JavaScript does not allow method calls on `null`, you'll have to
-wrap an expected null with [`Must`](#Must). Assigning `require("must")` to
-`expect` or `demand` works well.
-
-If you want to assert that an object's property is `null`, see
-[`property`](#Must.prototype.property).
-
-**Examples**:
-```javascript
-var demand = require("must")
-demand(null).be.null()
-```
-
-<a name="Must.prototype.number" />
-### Must.prototype.number()
-Assert object is a number.
-Boxed number objects (`new Number`) are _not_ considered numbers.
-
-**Examples**:
-```javascript
-(42).must.be.a.number()
-```
-
-<a name="Must.prototype.object" />
-### Must.prototype.object()
-Assert object is an.. object.
-
-**Examples**:
-```javascript
-({}).must.be.an.object()
-```
-
-<a name="Must.prototype.own" />
-### Must.prototype.own(property, [value])
-Alias of [`ownProperty`](#Must.prototype.ownProperty).
-
-<a name="Must.prototype.ownKeys" />
-### Must.prototype.ownKeys(keys)
-Assert that an object has only the expected enumerable `keys` of its own.
-Pass an array of strings as `keys`.
-
-**Does not** take **inherited properties** into account. To do so, see
-[`keys`](#Must.prototype.keys).
-
-**Examples**:
-```javascript
-({life: 42, love: 69}).must.have.ownKeys(["life", "love"])
-```
-
-<a name="Must.prototype.ownProperties" />
-### Must.prototype.ownProperties(properties)
-Assert that an object has all of the properties given in `properties` with
-equal (`===`) values and that they're own properties. In other words,
-asserts that the given object is a subset of the one asserted against.
-
-**Does not** take **inherited properties** into account. To do so, see
-[`properties`](#Must.prototype.properties).
-
-**Examples**:
-```javascript
-var john = {name: "John", age: 42, sex: "male"}
-john.must.have.ownProperties({name: "John", sex: "male"})
-```
-
-<a name="Must.prototype.ownProperty" />
-### Must.prototype.ownProperty(property, [value])
-Assert that an object has own property `property`.
-Optionally assert it *equals* (`===`) to `value`.
-
-**Does not** take **inherited properties** into account. To do so, see
-[`property`](#Must.prototype.property).
-
-**Examples**:
-```javascript
-({life: 42, love: 69}).must.have.ownProperty("love", 69)
-```
-
-<a name="Must.prototype.permutationOf" />
-### Must.prototype.permutationOf(expected)
-Assert that an array is a permutation of the given array.
-
-An array is a permutation of another if they both have the same elements
-(including the same number of duplicates) regardless of their order.
-Elements are checked with strict equals (`===`).
-
-**Examples**:
-```javascript
-[1, 1, 2, 3].must.be.a.permutationOf([3, 2, 1, 1])
-[7, 8, 8, 9].must.not.be.a.permutationOf([9, 8, 7])
-```
-
-<a name="Must.prototype.properties" />
-### Must.prototype.properties(properties)
-Assert that an object has all of the properties given in `properties` with
-equal (`===`) values. In other words, asserts that the given object is
-a subset of the one asserted against.
-
-Takes **inherited properties** into account. To not do so, see
-[`ownProperties`](#Must.prototype.ownProperties).
-
-**Examples**:
-```javascript
-var john = {name: "John", age: 42, sex: "male"}
-john.must.have.properties({name: "John", sex: "male"})
-```
-
-<a name="Must.prototype.property" />
-### Must.prototype.property(property, [value])
-Assert that an object has property `property`.
-Optionally assert it *equals* (`===`) to `value`.
-
-Takes **inherited properties** into account. To not do so, see
-[`ownProperty`](#Must.prototype.ownProperty).
-
-**Examples**:
-```javascript
-(function() {}).must.have.property("call")
-({life: 42, love: 69}).must.have.property("love", 69)
-```
-
-<a name="Must.prototype.regexp" />
-### Must.prototype.regexp()
-Assert object is a regular expression.
-
-**Examples**:
-```javascript
-/[a-z]/.must.be.a.regexp()
-```
-
-<a name="Must.prototype.reject" />
-### Must.prototype.reject
-Makes any matcher following the use of `reject` wait till a promise
-is rejected before asserting.
-Returns a new promise that will either resolve if the assertion passed or
-fail with `AssertionError`.
-
-Promises are transparent to matchers, so everything will also work with
-customer matchers you've added to `Must.prototype`. Internally Must just
-waits on the promise and calls the matcher function once it's rejected.
-
-With [Mocha](http://mochajs.org), using this will look something like:
-
-```javascript
-it("must pass", function() {
- return Promise.reject(42).must.reject.to.equal(42)
-})
-```
-
-Using [CoMocha](https://github.com/blakeembrey/co-mocha), it'll look like:
-```javascript
-it("must pass", function*() {
- yield Promise.reject(42).must.reject.to.equal(42)
- yield Promise.reject([1, 2, 3]).must.reject.to.not.include(42)
-})
-```
-
-**Examples**:
-```javascript
-Promise.reject(42).must.reject.to.equal(42)
-Promise.reject([1, 2, 3]).must.reject.to.not.include(42)
-```
-
-<a name="Must.prototype.resolve" />
-### Must.prototype.resolve
-Makes any matcher following the use of `resolve` wait till a promise
-resolves before asserting.
-Returns a new promise that will either resolve if the assertion passed or
-fail with `AssertionError`.
-
-Promises are transparent to matchers, so everything will also work with
-customer matchers you've added to `Must.prototype`. Internally Must just
-waits on the promise and calls the matcher function once it's resolved.
-
-With [Mocha](http://mochajs.org), using this will look something like:
-
-```javascript
-it("must pass", function() {
- return Promise.resolve(42).must.resolve.to.equal(42)
-})
-```
-
-Using [CoMocha](https://github.com/blakeembrey/co-mocha), it'll look like:
-```javascript
-it("must pass", function*() {
- yield Promise.resolve(42).must.resolve.to.equal(42)
- yield Promise.resolve([1, 2, 3]).must.resolve.to.not.include(42)
-})
-```
-
-**Examples**:
-```javascript
-Promise.resolve(42).must.resolve.to.equal(42)
-Promise.resolve([1, 2, 3]).must.resolve.to.not.include(42)
-```
-
-<a name="Must.prototype.startWith" />
-### Must.prototype.startWith(expected)
-Assert a string starts with the given string.
-
-**Examples**:
-```javascript
-"Hello, John".must.startWith("Hello")
-```
-
-<a name="Must.prototype.string" />
-### Must.prototype.string()
-Assert object is a string.
-Boxed string objects (`new String`) are _not_ considered strings.
-
-**Examples**:
-```javascript
-"Hello".must.be.a.string()
-```
-
-<a name="Must.prototype.symbol" />
-### Must.prototype.symbol()
-Assert object is a symbol.
-
-**Examples**:
-```javascript
-Symbol().must.be.a.symbol()
-```
-
-<a name="Must.prototype.the" />
-### Must.prototype.the
-Pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-(42).must.be.the.number()
-```
-
-<a name="Must.prototype.then" />
-### Must.prototype.then
-Alias of [`resolve`](#Must.prototype.resolve).
-
-**Examples**:
-```javascript
-Promise.resolve(42).must.then.equal(42)
-```
-
-<a name="Must.prototype.throw" />
-### Must.prototype.throw([constructor], [expected])
-Assert that a function throws.
-Optionally assert it throws `expected` (and/or is of instance
-`constructor`).
-When you already have an error reference, use
-[`error`](#Must.prototype.error).
-
-Given `expected`, the error is asserted as follows:
-- A **string** is compared with the exception's `message` property.
-- A **regular expression** is matched against the exception's `message`
- property.
-- A **function** (a.k.a. constructor) is used to check if the error
- is an `instanceof` that constructor.
-- All other cases of `expected` are left unspecified for now.
-
-Because of how JavaScript works, the function will be called in `null`
-context (`this`). If you want to test an instance method, bind it:
-`obj.method.bind(obj).must.throw()`.
-
-**Examples**:
-```javascript
-function omg() {
- throw new RangeError("Everything's amazing and nobody's happy")
-}
-
-omg.must.throw()
-omg.must.throw("Everything's amazing and nobody's happy")
-omg.must.throw(/amazing/)
-omg.must.throw(Error)
-omg.must.throw(RangeError)
-omg.must.throw(RangeError, "Everything's amazing and nobody's happy")
-omg.must.throw(RangeError, /amazing/)
-```
-
-<a name="Must.prototype.to" />
-### Must.prototype.to
-Pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-var expect = require("must")
-expect(true).to.be.true()
-
-var wish = require("must")
-wish(life).to.be.truthy()
-```
-
-<a name="Must.prototype.true" />
-### Must.prototype.true()
-Assert object is `true`.
-A boxed boolean object (`new Boolean(true`) is _not_ considered true.
-
-**Examples**:
-```javascript
-true.must.be.true()
-```
-
-<a name="Must.prototype.truthy" />
-### Must.prototype.truthy()
-Assert object is truthy (`!!obj`).
-
-Only `null`, `undefined`, `0`, `false` and `""` are falsy in JavaScript.
-Everything else is truthy.
-
-**Examples**:
-```javascript
-(42).must.be.truthy()
-"Hello".must.be.truthy()
-```
-
-<a name="Must.prototype.undefined" />
-### Must.prototype.undefined()
-Assert object is `undefined`.
-
-Because JavaScript does not allow method calls on `undefined`, you'll have to
-wrap an expected undefined with [`Must`](#Must). Assigning `require("must")`
-to `expect` or `demand` works well.
-
-If you want to assert that an object's property is `undefined`, see
-[`property`](#Must.prototype.property).
-
-**Examples**:
-```javascript
-var demand = require("must")
-demand(undefined).be.undefined()
-```
-
-<a name="Must.prototype.with" />
-### Must.prototype.with
-Pass-through property for a fluent chain.
-
-**Examples**:
-```javascript
-Promise.resolve(42).must.resolve.with.number()
-```
-
-
-<a name="Object" />
-Object
-------
-
-
-<a name="Object.prototype.must" />
-### Object.prototype.must
-Creates an instance of [`Must`](#Must) with the current object for asserting
-and calling matchers on.
-
-This property is non-enumerable just like built-in properties, so
-it'll never interfere with any regular usage of objects.
-
-Please note that JavaScript does not allow method calls on `null` or
-`undefined`, so you'll sometimes have to call [`Must`](#Must) on them by
-hand. Assigning `require("must")` to `expect` or `demand` works well with
-those cases.
-
-**Examples**:
-```javascript
-true.must.be.true()
-[].must.be.empty()
-```
-
-
-<a name="AssertionError" />
-AssertionError(message, [options])
-----------------------------------
-Error object thrown when an assertion fails.
-
-<a name="assertionError.actual" />
-### assertionError.actual
-The asserted object.
-
-<a name="assertionError.diffable" />
-### assertionError.diffable
-Whether it makes sense to compare objects granularly or even show a diff
-view of the objects involved.
-
-Most matchers (e.g. [`empty`](#Must.prototype.empty) and
-[`string`](#Must.prototype.string)) are concrete, strict and atomic and
-don't lend themselves to be compared property by property. Others however,
-like [`eql`](#Must.prototype.eql), are more granular and comparing them
-line by line helps understand how they differ.
-
-<a name="assertionError.expected" />
-### assertionError.expected
-If the matcher took an argument or asserted against something (like
-`foo.must.be.true()`), then this is the expected value.
-
-<a name="assertionError.showDiff" />
-### assertionError.showDiff
-Alias of [`diffable`](#assertionError.diffable).
-Some test runners (like [Mocha](http://visionmedia.github.io/mocha/)) expect
-this property instead.
-
-<a name="assertionError.stack" />
-### assertionError.stack
-The stack trace starting from the code that called `must`.
diff --git a/must/lib/assertion_error.js b/must/lib/assertion_error.js
deleted file mode 100644
index df83f67..0000000
--- a/must/lib/assertion_error.js
+++ /dev/null
@@ -1,73 +0,0 @@
-var O = require("oolong")
-var FIRST_LINE = /^.*$/m
-module.exports = AssertionError
-
-/**
- * Error object thrown when an assertion fails.
- *
- * @class AssertionError
- * @constructor
- * @param message
- * @param [options]
- */
-function AssertionError(msg, opts) {
- this.message = msg
-
- /**
- * The asserted object.
- *
- * @property actual
- */
- if (opts && "actual" in opts) this.actual = opts.actual
-
- /**
- * If the matcher took an argument or asserted against something (like
- * `foo.must.be.true()`), then this is the expected value.
- *
- * @property expected
- */
- if (opts && "expected" in opts) this.expected = opts.expected
-
- /**
- * Whether it makes sense to compare objects granularly or even show a diff
- * view of the objects involved.
- *
- * Most matchers (e.g. [`empty`](#Must.prototype.empty) and
- * [`string`](#Must.prototype.string)) are concrete, strict and atomic and
- * don't lend themselves to be compared property by property. Others however,
- * like [`eql`](#Must.prototype.eql), are more granular and comparing them
- * line by line helps understand how they differ.
- *
- * @property diffable
- */
- if (opts && "diffable" in opts) this.diffable = opts.diffable
-
- /**
- * The stack trace starting from the code that called `must`.
- *
- * @property stack
- */
- if (opts && opts.stack != null) Object.defineProperty(this, "stack", {
- value: opts.stack.replace(FIRST_LINE, this),
- configurable: true, writable: true
- })
- else if (Error.captureStackTrace)
- Error.captureStackTrace(this, opts && opts.caller || this.constructor)
-}
-
-AssertionError.prototype = Object.create(Error.prototype, {
- constructor: {value: AssertionError, configurable: true, writable: true}
-})
-
-AssertionError.prototype.name = "AssertionError"
-
-/**
- * Some test runners (like [Mocha](http://visionmedia.github.io/mocha/)) expect
- * this property instead.
- *
- * @property showDiff
- * @alias diffable
- */
-O.defineGetter(AssertionError.prototype, "showDiff", function() {
- return this.diffable
-})
diff --git a/must/lib/es6.js b/must/lib/es6.js
deleted file mode 100644
index 27bfcda..0000000
--- a/must/lib/es6.js
+++ /dev/null
@@ -1,17 +0,0 @@
-exports.setPrototypeOf = Object.setPrototypeOf || function(obj, prototype) {
- /* eslint no-proto: 0 */
- obj.__proto__ = prototype
- return obj
-}
-
-exports.startsWith = String.prototype.startsWith ?
- Function.call.bind(String.prototype.startsWith) :
- function(haystack, needle) {
- return haystack.lastIndexOf(needle, 0) === 0
-}
-
-exports.endsWith = String.prototype.endsWith ?
- Function.call.bind(String.prototype.endsWith) :
- function(haystack, needle) {
- return haystack.indexOf(needle, haystack.length - needle.length) >= 0
-}
diff --git a/must/lib/index.js b/must/lib/index.js
deleted file mode 100644
index e34cb06..0000000
--- a/must/lib/index.js
+++ /dev/null
@@ -1,57 +0,0 @@
-var kindof = require("kindof")
-var jsonify = require("json-stringify-safe")
-var setPrototypeOf = require("./es6").setPrototypeOf
-var INDENT = null
-
-exports.chain = function(self, fn) {
- if (typeof fn != "function") throw new TypeError("Not a function: " + fn)
-
- // Don't set toString as it seems to break "source-map-support". This is
- // a function with an Object prototype, after all.
- return Object.defineProperties(setPrototypeOf(fn.bind(self), self), {
- bind: {value: Function.prototype.apply, configurable: true, writable: true},
- call: {value: Function.prototype.apply, configurable: true, writable: true},
- apply: {value: Function.prototype.apply, configurable: true, writable: true}
- })
-}
-
-exports.stringify = function stringify(obj) {
- var root = obj
-
- switch (kindof(obj)) {
- // Allow falling through:
- /* jshint -W086 */
- /* eslint no-fallthrough: 0 */
- case "null": return "null"
- case "undefined": return "undefined"
- case "number": return obj.toString()
- case "string": return JSON.stringify(obj)
- case "symbol": return obj.toString()
- case "regexp": return obj.toString()
- case "date": return obj.toISOString()
- case "function": return obj.toString()
-
- case "object":
- obj = clone(obj)
- if (root instanceof Error) obj.message = root.message
- // Fall through.
-
- default: return jsonify(obj, stringifyValue, INDENT)
- }
-}
-
-function clone(obj) {
- var clone = {}, value
- for (var key in obj) clone[key] = (value = obj[key]) === obj ? clone : value
- return clone
-}
-
-function stringifyValue(key, value) {
- switch (kindof(value)) {
- case "undefined": return "[Undefined]"
- case "number": return isNaN(value) ? "[NaN]" : value
- case "symbol": return value.toString()
- case "regexp": return value.toString()
- default: return value
- }
-}
diff --git a/must/lib/rejectable.js b/must/lib/rejectable.js
deleted file mode 100644
index 5bdc43d..0000000
--- a/must/lib/rejectable.js
+++ /dev/null
@@ -1,17 +0,0 @@
-var AssertionError = require("./assertion_error")
-var Thenable = require("./thenable")
-var then = Thenable.prototype.then
-
-module.exports = function(must) {
- return Thenable(must, promisify)
-}
-
-function promisify(fn) {
- return function matcher() {
- var must = Object.create(this)
- if (Error.captureStackTrace) Error.captureStackTrace(must, matcher)
- return this.actual.then(raise, then.bind(must, fn, arguments))
- }
-}
-
-function raise() { throw new AssertionError("Resolved") }
diff --git a/must/lib/resolvable.js b/must/lib/resolvable.js
deleted file mode 100644
index 4318165..0000000
--- a/must/lib/resolvable.js
+++ /dev/null
@@ -1,13 +0,0 @@
-var Thenable = require("./thenable")
-
-module.exports = function(must) {
- return Thenable(must, promisify)
-}
-
-function promisify(fn) {
- return function matcher() {
- var must = Object.create(this)
- if (Error.captureStackTrace) Error.captureStackTrace(must, matcher)
- return this.actual.then(Thenable.prototype.then.bind(must, fn, arguments))
- }
-}
diff --git a/must/lib/thenable.js b/must/lib/thenable.js
deleted file mode 100644
index 2e0b4cd..0000000
--- a/must/lib/thenable.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var wrap = require("lodash.wrap")
-var lookupGetter = require("oolong").lookupGetter
-
-exports = module.exports = function(must, promisify) {
- must = Object.create(must)
-
- for (var name in must)
- if (hasFunction(must, name)) must[name] = promisify(must[name])
-
- Object.defineProperty(must, "assert", {
- value: wrap(must.assert, exports.prototype.assert),
- configurable: true, writable: true
- })
-
- return must
-}
-
-exports.prototype.assert = function assert(orig, ok, msg, opts) {
- opts = opts ? Object.create(opts) : {}
- if ("stack" in this) opts.stack = this.stack
- orig.call(this, ok, msg, opts)
-}
-
-exports.prototype.then = function(fn, args, actual) {
- this.actual = actual
- fn.apply(this, args)
-}
-
-function hasFunction(obj, name) {
- return !lookupGetter(obj, name) && typeof obj[name] == "function"
-}
diff --git a/must/must.d.ts b/must/must.d.ts
deleted file mode 100644
index 2f2c2ec..0000000
--- a/must/must.d.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-interface Must {
- a: CallableMust;
- above(expected): Must;
- after(expected): Must;
- an: CallableMust;
- array(): Must;
- at: Must;
- be: CallableMust;
- before(expected): Must;
- below(expected): Must;
- between(begin, end): Must;
- boolean(): Must;
- contain(expected): Must;
- date(expected): Must;
- empty(): Must;
- endWith(expected: string): Must;
- enumerable(property: string): Must;
- enumerableProperty(property: string): Must;
- eql(expected): Must;
- equal(expected): Must;
- error(constructor?, expected?): Must;
- eventually: Must;
- exist(): Must;
- false(): Must;
- falsy(): Must;
- frozen(): Must;
- function(): Must;
- gt(expected: number): Must;
- gte(expected: number): Must;
- have: Must;
- include(expected): Must;
- instanceOf(expected): Must;
- instanceof(expected): Must;
- is(expected): Must;
- keys(expected: Array<string>): Must;
- least(expected): Must;
- length(expected: number): Must;
- lt(expected: number): Must;
- lte(expected: number): Must;
- match(expected): Must;
- most(expected: number): Must;
- must: Must;
- nan(): Must;
- nonenumerable(property: string): Must;
- nonenumerableProperty(property: string): Must;
- not: Must;
- null(): Must;
- number(): Must;
- object(): Must;
- own(property: string, value?): Must;
- ownKeys(keys: Array<string>): Must;
- ownProperties(properties: any): Must;
- ownProperty(property: string, value?): Must;
- permutationOf(expected: Array<any>): Must;
- properties(properties: any): Must;
- property(property: string, value?): Must;
- regexp(): Must;
- reject: Must;
- resolve: Must;
- startWith(expected: string): Must;
- string(): Must;
- symbol(): Must;
- the: Must;
- then: Must;
- throw(constructor?, expected?): Must;
- to: Must;
- true(): Must;
- truthy(): Must;
- undefined(): Must;
- with: Must;
-}
-interface CallableMust extends Must {
- (): Must;
-}
-declare function must(expected: any): Must;
-declare namespace must {}
-
-export = must;
-
-declare global {
- interface String {
- must: Must;
- }
- interface Boolean {
- must: Must;
- }
- interface Number {
- must: Must;
- }
- interface Object {
- must: Must;
- }
- interface Array<T> {
- must: Must;
- }
-}
diff --git a/must/must.js b/must/must.js
deleted file mode 100644
index 7ff0c66..0000000
--- a/must/must.js
+++ /dev/null
@@ -1,1288 +0,0 @@
-var O = require("oolong")
-var AssertionError = require("./lib/assertion_error")
-var Resolvable = require("./lib/resolvable")
-var Rejectable = require("./lib/rejectable")
-var kindof = require("kindof")
-var egal = require("egal")
-var deepEgal = egal.deepEgal
-var stringify = require("./lib").stringify
-var chain = require("./lib").chain
-var defineGetter = O.defineGetter
-var lookupGetter = O.lookupGetter
-var startsWith = require("./lib/es6").startsWith
-var endsWith = require("./lib/es6").endsWith
-var hasOwn = Function.call.bind(Object.hasOwnProperty)
-var ANY = {}
-exports = module.exports = Must
-exports.AssertionError = AssertionError
-exports.stringify = stringify
-exports.chain = chain
-
-/**
- * The main class that wraps the asserted object and that you call matchers on.
- *
- * To include a custom error message for failure cases, pass a string as the
- * second argument.
- *
- * Most of the time you'll be using
- * [`Object.prototype.must`](#Object.prototype.must) to create this wrapper, but
- * occasionally you might want to assert `null`s or `undefined`s and in those
- * cases assigning `Must` to something like `expect` or `demand` works nicely.
- *
- * @example
- * true.must.be.true()
- * [].must.be.empty()
- *
- * var expect = require("must")
- * expect(null).to.be.null()
- *
- * var demand = require("must")
- * demand(undefined, "The undefined undefineds").be.undefined()
- *
- * @class Must
- * @constructor
- * @param actual
- * @param [message]
- */
-function Must(actual, message) {
- if (!(this instanceof Must)) return new Must(actual, message)
- this.actual = actual
- if (message != null) this.message = message
-}
-
-/**
- * Can also be used a pass-through property for a fluent chain.
- *
- * @example
- * "Hello".must.be.a.string()
- * new Date().must.be.a(Date)
- *
- * @method a
- * @alias instanceof
- */
-defineGetter(Must.prototype, "a", function() {
- return chain(this, this.instanceof)
-})
-
-/**
- * Can also be used a pass-through property for a fluent chain.
- *
- * @example
- * [1, 2].must.be.an.array()
- * new AwesomeClass().must.be.an(AwesomeClass)
- *
- * @method an
- * @alias instanceof
- */
-defineGetter(Must.prototype, "an", lookupGetter(Must.prototype, "a"))
-
-/**
- * Pass-through property for a fluent chain.
- *
- * @example
- * (42).must.be.at.most(69)
- * (1337).must.be.at.least(1337)
- *
- * @property at
- * @on prototype
- */
-defineGetter(Must.prototype, "at", passthrough)
-
-/**
- * Can also be used as a pass-through property for a fluent chain.
- *
- * @example
- * true.must.be.true()
- * (42).must.be(42)
- *
- * @method be
- * @alias equal
- */
-defineGetter(Must.prototype, "be", function() {
- return chain(this, this.equal)
-})
-
-/**
- * Pass-through property for a fluent chain.
- *
- * @example
- * [1, 2].must.have.length(2)
- *
- * @property have
- * @on prototype
- */
-defineGetter(Must.prototype, "have", passthrough)
-
-/**
- * Inverse the assertion.
- * Use it multiple times to create lots of fun!
- * `true.must.not.not.be.true()` :-)
- *
- * @example
- * true.must.not.be.true()
- * [].must.not.be.empty()
- *
- * @property not
- * @on prototype
- */
-defineGetter(Must.prototype, "not", function() {
- // NOTE: Dear reader or plugin author, please don't depend on this property
- // name will remain as-is. If you really need to, let me know how you'd like
- // to use it. XO.
- var self = Object.create(this)
- self.negative = !self.negative
- return self
-})
-
-/**
- * Pass-through property for a fluent chain.
- *
- * @example
- * var expect = require("must")
- * expect(true).to.be.true()
- *
- * var wish = require("must")
- * wish(life).to.be.truthy()
- *
- * @property to
- * @on prototype
- */
-defineGetter(Must.prototype, "to", passthrough)
-
-/**
- * Assert object is `true`.
- * A boxed boolean object (`new Boolean(true`) is _not_ considered true.
- *
- * @example
- * true.must.be.true()
- *
- * @method true
- */
-Must.prototype.true = function() {
- this.assert(this.actual === true, "be", {expected: true})
-}
-
-/**
- * Assert object is `false`.
- * A boxed boolean object (`new Boolean(false`) is _not_ considered false.
- *
- * @example
- * false.must.be.false()
- * @method false
- *
- */
-Must.prototype.false = function() {
- this.assert(this.actual === false, "be", {expected: false})
-}
-
-/**
- * Assert object is `NaN`.
- *
- * @example
- * NaN.must.be.nan()
- *
- * @method nan
- */
-Must.prototype.nan = function() {
- this.assert(this.actual !== this.actual, "be", {expected: NaN})
-}
-
-/**
- * Assert object is `null`.
- *
- * Because JavaScript does not allow method calls on `null`, you'll have to
- * wrap an expected null with [`Must`](#Must). Assigning `require("must")` to
- * `expect` or `demand` works well.
- *
- * If you want to assert that an object's property is `null`, see
- * [`property`](#Must.prototype.property).
- *
- * @example
- * var demand = require("must")
- * demand(null).be.null()
- *
- * @method null
- */
-Must.prototype.null = function() {
- this.assert(this.actual === null, "be", {expected: null})
-}
-
-/**
- * Assert object is `undefined`.
- *
- * Because JavaScript does not allow method calls on `undefined`, you'll have to
- * wrap an expected undefined with [`Must`](#Must). Assigning `require("must")`
- * to `expect` or `demand` works well.
- *
- * If you want to assert that an object's property is `undefined`, see
- * [`property`](#Must.prototype.property).
- *
- * @example
- * var demand = require("must")
- * demand(undefined).be.undefined()
- *
- * @method undefined
- */
-Must.prototype.undefined = function() {
- this.assert(this.actual === undefined, "be", {expected: undefined})
-}
-
-/**
- * Assert object is a boolean (`true` or `false`).
- * Boxed boolean objects (`new Boolean`) are _not_ considered booleans.
- *
- * @example
- * true.must.be.a.boolean()
- *
- * @method boolean
- */
-Must.prototype.boolean = function() {
- this.assert(typeof this.actual == "boolean", "be a boolean")
-}
-
-/**
- * Assert object is a number.
- * Boxed number objects (`new Number`) are _not_ considered numbers.
- *
- * @example
- * (42).must.be.a.number()
- *
- * @method number
- */
-Must.prototype.number = function() {
- this.assert(typeof this.actual == "number", "be a number")
-}
-
-/**
- * Assert object is a string.
- * Boxed string objects (`new String`) are _not_ considered strings.
- *
- * @example
- * "Hello".must.be.a.string()
- *
- * @method string
- */
-Must.prototype.string = function() {
- this.assert(typeof this.actual == "string", "be a string")
-}
-
-/**
- * Assert object is a symbol.
- *
- * @example
- * Symbol().must.be.a.symbol()
- *
- * @method symbol
- */
-Must.prototype.symbol = function() {
- this.assert(typeof this.actual == "symbol", "be a symbol")
-}
-
-/**
- * Assert object is a date.
- *
- * @example
- * new Date().must.be.a.date()
- *
- * @method date
- */
-Must.prototype.date = function() {
- this.assert(kindof(this.actual) == "date", "be a date")
-}
-
-/**
- * Assert object is a regular expression.
- *
- * @example
- * /[a-z]/.must.be.a.regexp()
- *
- * @method regexp
- */
-Must.prototype.regexp = function() {
- this.assert(kindof(this.actual) == "regexp", "be a regular expression")
-}
-
-/**
- * Assert object is an array.
- *
- * @example
- * [42, 69].must.be.an.array()
- *
- * @method array
- */
-Must.prototype.array = function() {
- this.assert(Array.isArray(this.actual), "be an array")
-}
-
-/**
- * Assert object is a function.
- *
- * @example
- * (function() {}).must.be.a.function()
- *
- * @method function
- */
-Must.prototype.function = function() {
- this.assert(typeof this.actual == "function", "be a function")
-}
-
-/**
- * Assert object is an.. object.
- *
- * @example
- * ({}).must.be.an.object()
- *
- * @method object
- */
-Must.prototype.object = function() {
- var ok = this.actual && typeof this.actual == "object"
- this.assert(ok, "be an object")
-}
-
-/**
- * Assert object is truthy (`!!obj`).
- *
- * Only `null`, `undefined`, `0`, `false` and `""` are falsy in JavaScript.
- * Everything else is truthy.
- *
- * @example
- * (42).must.be.truthy()
- * "Hello".must.be.truthy()
- *
- * @method truthy
- */
-Must.prototype.truthy = function() {
- this.assert(this.actual, "be truthy")
-}
-
-/**
- * Assert object is falsy (`!obj`).
- *
- * Only `null`, `undefined`, `0`, `false` and `""` are falsy in JavaScript.
- * Everything else is truthy.
- *
- * @example
- * 0.must.be.falsy()
- * "".must.be.falsy()
- *
- * @method falsy
- */
-Must.prototype.falsy = function() {
- this.assert(!this.actual, "be falsy")
-}
-
-/**
- * Assert object is exists and thereby is not null or undefined.
- *
- * @example
- * 0.must.exist()
- * "".must.exist()
- * ({}).must.exist()
- *
- * @method exist
- */
-Must.prototype.exist = function() {
- this.assert(this.actual != null, "exist")
-}
-
-/**
- * Assert that an object is an instance of something.
- * Uses `obj instanceof expected`.
- *
- * @example
- * new Date().must.be.an.instanceof(Date)
- *
- * @method instanceof
- * @param class
- */
-Must.prototype.instanceof = function(expected) {
- var ok = this.actual instanceof expected
- this.assert(ok, instanceofMessage.bind(this, expected), {expected: expected})
-}
-
-function instanceofMessage(expected) {
- var type = expected.displayName || expected.name || stringify(expected)
- return "be an instance of " + type
-}
-
-/**
- * @method instanceOf
- * @alias instanceof
- */
-Must.prototype.instanceOf = Must.prototype.instanceof
-
-/**
- * Assert that an object is empty.
- * Checks either the `length` for arrays and strings or the count of
- * enumerable keys. Inherited keys also counted.
- *
- * @example
- * "".must.be.empty()
- * [].must.be.empty()
- * ({}).must.be.empty()
- *
- * @method empty
- */
-Must.prototype.empty = function() {
- var ok = false
- if (typeof this.actual === "string" || Array.isArray(this.actual))
- ok = this.actual.length === 0
- else if (typeof this.actual == "object" || typeof this.actual == "function")
- ok = O.isEmpty(this.actual)
-
- this.assert(ok, "be empty")
-}
-
-/**
- * Assert a string ends with the given string.
- *
- * @example
- * "Hello, John".must.endWith("John")
- *
- * @method endWith
- * @param expected
- */
-Must.prototype.endWith = function(expected) {
- this.assert(endsWith(this.actual, expected), "end with", {expected: expected})
-}
-
-/**
- * Assert object strict equality or identity (`===`).
- *
- * To compare value objects (like `Date` or `RegExp`) by their value rather
- * than identity, use [`eql`](#Must.prototype.eql).
- * To compare arrays and objects by content, also use
- * [`eql`](#Must.prototype.eql).
- *
- * @example
- * (42).must.equal(42)
- *
- * var date = new Date
- * date.must.equal(date)
- *
- * @method equal
- * @param expected
- */
-Must.prototype.equal = function(expected) {
- this.assert(this.actual === expected, "equal", {expected: expected})
-}
-
-/**
- * Assert that an object is an error (instance of `Error` by default).
- * Optionally assert it matches `expected` (and/or is of instance
- * `constructor`).
- * When you have a function that's supposed to throw, use
- * [`throw`](#Must.prototype.throw).
- *
- * Given `expected`, the error is asserted as follows:
- * - A **string** is compared with the exception's `message` property.
- * - A **regular expression** is matched against the exception's `message`
- * property.
- * - A **function** (a.k.a. constructor) is used to check if the error
- * is an `instanceof` that constructor.
- * - All other cases of `expected` are left unspecified for now.
- *
- * @example
- * var err = throw new RangeError("Everything's amazing and nobody's happy") }
- * err.must.be.an.error()
- * err.must.be.an.error("Everything's amazing and nobody's happy")
- * err.must.be.an.error(/amazing/)
- * err.must.be.an.error(Error)
- * err.must.be.an.error(RangeError)
- * err.must.be.an.error(RangeError, "Everything's amazing and nobody's happy")
- * err.must.be.an.error(RangeError, /amazing/)
- *
- * @method error
- * @param [constructor]
- * @param [expected]
- */
-Must.prototype.error = function(type, expected) {
- if (arguments.length <= 1) expected = ANY
- if (arguments.length == 1 && !isFn(type)) { expected = type; type = null }
-
- var ok = isError(this.actual, type || Error, expected)
- var msg = expected !== ANY ? "be an error matching" : "be an error"
- var opts = expected !== ANY ? {expected: expected} : null
- this.assert(ok, msg, opts)
-}
-
-/**
- * Can also be used as a pass-through property for a fluent chain.
- *
- * @example
- * var claim = require("must")
- * claim(true).is.true()
- * claim(42).is(42)
- *
- * @method is
- * @alias equal
- */
-defineGetter(Must.prototype, "is", lookupGetter(Must.prototype, "be"))
-
-/**
- * Assert object equality by content and if possible, recursively.
- * Also handles circular and self-referential objects.
- *
- * For most parts it asserts strict equality (`===`), but:
- * - `RegExp` objects are compared by their pattern and flags.
- * - `Date` objects are compared by their value.
- * - `Array` objects are compared recursively.
- * - `NaN`s are considered equivalent.
- * - Instances of the same class with a `valueOf` function are compared by its
- * output.
- * - Plain objects and instances of the same class are compared recursively.
- *
- * **Does not coerce types** so **mismatching types fail**.
- * Inherited enumerable properties are also taken into account.
- *
- * **Instances** are objects whose prototype's `constructor` property is set.
- * E.g. `new MyClass`.
- * Others, like `{}` or `Object.create({})`, are **plain objects**.
- *
- * @example
- * /[a-z]/.must.eql(/[a-z]/)
- * new Date(1987, 5, 18).must.eql(new Date(1987, 5, 18))
- * ["Lisp", 42].must.eql(["Lisp", 42])
- * ({life: 42, love: 69}).must.eql({life: 42, love: 69})
- * NaN.must.eql(NaN)
- *
- * function Answer(answer) { this.answer = answer }
- * new Answer(42).must.eql(new Answer(42))
- *
- * @method eql
- * @param expected
- */
-Must.prototype.eql = function(expected) {
- var ok = deepEgal(this.actual, expected, eql)
- this.assert(ok, "be equivalent to", {expected: expected, diffable: true})
-}
-
-/**
- * Assert object includes `expected`.
- *
- * For strings it checks the text, for arrays it checks elements and for
- * objects the property values. Everything is checked with strict equals
- * (`===`).
- *
- * @example
- * "Hello, John!".must.include("John")
- * [1, 42, 3].must.include(42)
- * ({life: 42, love: 69}).must.include(42)
- *
- * @method include
- * @param expected
- */
-Must.prototype.include = function(expected) {
- var found
- if (typeof this.actual === "string" || Array.isArray(this.actual))
- found = this.actual.indexOf(expected) >= 0
- else
- for (var key in this.actual)
- if (this.actual[key] === expected) { found = true; break }
-
- this.assert(found, "include", {expected: expected})
-}
-
-/**
- * @method contain
- * @alias include
- */
-Must.prototype.contain = Must.prototype.include
-
-/**
- * Assert that an array is a permutation of the given array.
- *
- * An array is a permutation of another if they both have the same elements
- * (including the same number of duplicates) regardless of their order.
- * Elements are checked with strict equals (`===`).
- *
- * @example
- * [1, 1, 2, 3].must.be.a.permutationOf([3, 2, 1, 1])
- * [7, 8, 8, 9].must.not.be.a.permutationOf([9, 8, 7])
- *
- * @method permutationOf
- * @param expected
- */
-Must.prototype.permutationOf = function(expected) {
- var ok = isPermutationOf(this.actual, expected)
- this.assert(ok, "be a permutation of", {expected: expected, diffable: true})
-}
-
-function isPermutationOf(actual, expected) {
- if (!Array.isArray(actual) || !Array.isArray(expected)) return false
- if (actual.length !== expected.length) return false
-
- actual = actual.slice().sort()
- expected = expected.slice().sort()
- for (var i = 0; i < actual.length; i++) {
- if (actual[i] !== expected[i]) return false
- }
-
- return true
-}
-
-/**
- * Assert object matches the given regular expression.
- *
- * If you pass in a non regular expression object, it'll be converted to one
- * via `new RegExp(regexp)`.
- *
- * @example
- * "Hello, John!".must.match(/john/i)
- * "Wei wu wei".must.match("wu")
- *
- * @method match
- * @param regexp
- */
-Must.prototype.match = function(expected) {
- var regexp = expected instanceof RegExp ? expected : new RegExp(expected)
- this.assert(regexp.exec(this.actual), "match", {expected: regexp})
-}
-
-/**
- * Pass-through property for a fluent chain.
- *
- * @example
- * (42).must.must.must.must.equal(42)
- *
- * @property must
- * @on prototype
- */
-defineGetter(Must.prototype, "must", passthrough)
-
-/**
- * Pass-through property for a fluent chain.
- *
- * @example
- * (42).must.be.the.number()
- *
- * @property the
- * @on prototype
- */
-defineGetter(Must.prototype, "the", passthrough)
-
-/**
- * Assert that a function throws.
- * Optionally assert it throws `expected` (and/or is of instance
- * `constructor`).
- * When you already have an error reference, use
- * [`error`](#Must.prototype.error).
- *
- * Given `expected`, the error is asserted as follows:
- * - A **string** is compared with the exception's `message` property.
- * - A **regular expression** is matched against the exception's `message`
- * property.
- * - A **function** (a.k.a. constructor) is used to check if the error
- * is an `instanceof` that constructor.
- * - All other cases of `expected` are left unspecified for now.
- *
- * Because of how JavaScript works, the function will be called in `null`
- * context (`this`). If you want to test an instance method, bind it:
- * `obj.method.bind(obj).must.throw()`.
- *
- * @example
- * function omg() {
- * throw new RangeError("Everything's amazing and nobody's happy")
- * }
- *
- * omg.must.throw()
- * omg.must.throw("Everything's amazing and nobody's happy")
- * omg.must.throw(/amazing/)
- * omg.must.throw(Error)
- * omg.must.throw(RangeError)
- * omg.must.throw(RangeError, "Everything's amazing and nobody's happy")
- * omg.must.throw(RangeError, /amazing/)
- *
- * @method throw
- * @param [constructor]
- * @param [expected]
- */
-Must.prototype.throw = function(type, expected) {
- if (arguments.length <= 1) expected = ANY
- if (arguments.length == 1 && !isFn(type)) { expected = type; type = null }
-
- var ok = false, exception
- try { this.actual.call(null) } catch (ex) { ok = true; exception = ex }
- ok = ok && isError(exception, type, expected)
-
- var opts = {actual: exception}
- if (expected !== ANY) opts.expected = expected
- this.assert(ok, "throw", opts)
-}
-
-/**
- * Assert that an object has a length property equal to `expected`.
- *
- * @example
- * "Something or other".must.have.length(18)
- * [1, 2, 3, "Four o'clock rock"].must.have.length(4)
- *
- * @method length
- * @param expected
- */
-Must.prototype.length = function(expected) {
- var ok = this.actual.length == expected
- this.assert(ok, "have length of", {expected: expected})
-}
-
-/**
- * Assert that an object is frozen with `Object.isFrozen`.
- *
- * @example
- * Object.freeze({}).must.be.frozen()
- *
- * @method frozen
- */
-Must.prototype.frozen = function() {
- this.assert(Object.isFrozen(this.actual), "be frozen")
-}
-
-/**
- * Assert that an object has all of the properties given in `properties` with
- * equal (`===`) values. In other words, asserts that the given object is
- * a subset of the one asserted against.
- *
- * Takes **inherited properties** into account. To not do so, see
- * [`ownProperties`](#Must.prototype.ownProperties).
- *
- * @example
- * var john = {name: "John", age: 42, sex: "male"}
- * john.must.have.properties({name: "John", sex: "male"})
- *
- * @method properties
- * @param properties
- */
-Must.prototype.properties = function(props) {
- var obj = this.actual
- var ok = this.actual != null
-
- if (ok) for (var key in props) {
- ok = key in obj && obj[key] === props[key]
- if (!ok) break
- }
-
- this.assert(ok, "have properties", {expected: props, diffable: true})
-}
-
-/**
- * Assert that an object has all of the properties given in `properties` with
- * equal (`===`) values and that they're own properties. In other words,
- * asserts that the given object is a subset of the one asserted against.
- *
- * **Does not** take **inherited properties** into account. To do so, see
- * [`properties`](#Must.prototype.properties).
- *
- * @example
- * var john = {name: "John", age: 42, sex: "male"}
- * john.must.have.ownProperties({name: "John", sex: "male"})
- *
- * @method ownProperties
- * @param properties
- */
-Must.prototype.ownProperties = function(props) {
- var obj = this.actual
- var ok = this.actual != null
-
- if (ok) for (var key in props) {
- ok = key in obj && hasOwn(obj, key) && obj[key] === props[key]
- if (!ok) break
- }
-
- this.assert(ok, "have own properties", {expected: props, diffable: true})
-}
-
-/**
- * Assert that an object has property `property`.
- * Optionally assert it *equals* (`===`) to `value`.
- *
- * Takes **inherited properties** into account. To not do so, see
- * [`ownProperty`](#Must.prototype.ownProperty).
- *
- * @example
- * (function() {}).must.have.property("call")
- * ({life: 42, love: 69}).must.have.property("love", 69)
- *
- * @method property
- * @param property
- * @param [value]
- */
-Must.prototype.property = function(property, expected) {
- var ok = this.actual != null && property in Object(this.actual)
- if (ok && arguments.length > 1) ok = this.actual[property] === expected
-
- var msg = "have property \"" + property + "\"", opts
- if (arguments.length > 1) { msg += " equal to"; opts = {expected: expected} }
- this.assert(ok, msg, opts)
-}
-
-/**
- * Assert that an object has own property `property`.
- * Optionally assert it *equals* (`===`) to `value`.
- *
- * **Does not** take **inherited properties** into account. To do so, see
- * [`property`](#Must.prototype.property).
- *
- * @example
- * ({life: 42, love: 69}).must.have.ownProperty("love", 69)
- *
- * @method ownProperty
- * @param property
- * @param [value]
- */
-Must.prototype.ownProperty = function(property, expected) {
- var ok = this.actual != null
- ok = ok && hasOwn(this.actual, property)
- if (ok && arguments.length > 1) ok = this.actual[property] === expected
-
- var msg = "have own property \"" + property + "\"", opts
- if (arguments.length > 1) { msg += " equal to"; opts = {expected: expected} }
- this.assert(ok, msg, opts)
-}
-
-/**
- * @method own
- * @alias ownProperty
- */
-Must.prototype.own = Must.prototype.ownProperty
-
-/**
- * Assert that an object has only the expected enumerable `keys`.
- * Pass an array of strings as `keys`.
- *
- * Takes **inherited properties** into account. To not do so, see
- * [`ownKeys`](#Must.prototype.ownKeys).
- *
- * @example
- * ({life: 42, love: 69}).must.have.keys(["life", "love"])
- * Object.create({life: 42}).must.have.keys(["life"])
- *
- * @method keys
- * @param keys
- */
-Must.prototype.keys = function(expected) {
- var ok = this.actual != null
- ok = ok && isPermutationOf(O.keys(Object(this.actual)), expected)
- this.assert(ok, "have keys", {expected: expected})
-}
-
-/**
- * Assert that an object has only the expected enumerable `keys` of its own.
- * Pass an array of strings as `keys`.
- *
- * **Does not** take **inherited properties** into account. To do so, see
- * [`keys`](#Must.prototype.keys).
- *
- * @example
- * ({life: 42, love: 69}).must.have.ownKeys(["life", "love"])
- *
- * @method ownKeys
- * @param keys
- */
-Must.prototype.ownKeys = function(expected) {
- var ok = this.actual != null
- ok = ok && isPermutationOf(Object.keys(Object(this.actual)), expected)
- this.assert(ok, "have own keys", {expected: expected})
-}
-
-/**
- * Assert that an object has an enumerable property `property`.
- * It will fail if the object lacks the property entirely.
- *
- * This also checks inherited properties in the prototype chain, something which
- * `Object.prototype.propertyIsEnumerable` itself does not do.
- *
- * For checking if a property exists *and* is non-enumerable, see
- * [`nonenumerable`](#Must.prototype.nonenumerable).
- *
- * @example
- * ({life: 42, love: 69}).must.have.enumerable("love")
- *
- * @method enumerable
- * @param property
- */
-Must.prototype.enumerable = function(property) {
- var ok = this.actual != null
- ok = ok && isEnumerable(Object(this.actual), property)
- this.assert(ok, "have enumerable property \"" + property + "\"")
-}
-
-/**
- * @method enumerableProperty
- * @alias enumerable
- */
-Must.prototype.enumerableProperty = Must.prototype.enumerable
-
-/**
- * Assert that an object has a non-enumerable property `property`.
- * It will fail if the object lacks the property entirely.
- *
- * This also checks inherited properties in the prototype chain, something which
- * `Object.prototype.propertyIsEnumerable` itself does not do.
- *
- * It's the inverse of [`enumerable`](#Must.prototype.enumerable).
- *
- * @example
- * (function() {}).must.have.nonenumerable("call")
- * Object.create({}, {love: {enumerable: 0}}).must.have.nonenumerable("love")
- *
- * @method nonenumerable
- * @param property
- */
-Must.prototype.nonenumerable = function(property) {
- var ok = this.actual != null
- ok = ok && property in Object(this.actual)
- ok = ok && !isEnumerable(Object(this.actual), property)
- this.assert(ok, "have nonenumerable property \"" + property + "\"")
-}
-
-function isEnumerable(obj, name) {
- // Using propertyIsEnumerable saves a possible looping of all keys.
- if (Object.prototype.propertyIsEnumerable.call(obj, name)) return true
- for (var key in obj) if (key == name) return true
- return false
-}
-
-/**
- * @method nonenumerableProperty
- * @alias nonenumerable
- */
-Must.prototype.nonenumerableProperty = Must.prototype.nonenumerable
-
-/**
- * Assert that an object is below and less than (`<`) `expected`.
- * Uses `<` for comparison, so it'll also work with value objects (those
- * implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
- *
- * @example
- * (42).must.be.below(69)
- *
- * @method below
- * @param expected
- */
-Must.prototype.below = function(expected) {
- this.assert(this.actual < expected, "be below", {expected: expected})
-}
-
-/**
- * @method lt
- * @alias below
- */
-Must.prototype.lt = Must.prototype.below
-
-/**
- * Works well with dates where saying *before* is more natural than *below* or
- * *less than*.
- *
- * To assert that a date is equivalent to another date, use
- * [`eql`](#Must.prototype.eql). For regular numbers,
- * [`equal`](#Must.prototype.equal) is fine.
- *
- * @example
- * (42).must.be.before(1337)
- * new Date(2000, 5, 18).must.be.before(new Date(2001, 0, 1))
- *
- * @method before
- * @alias below
- */
-Must.prototype.before = Must.prototype.below
-
-/**
- * Assert that an object is at most, less than or equal to (`<=`), `expected`.
- * Uses `<=` for comparison, so it'll also work with value objects (those
- * implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
- *
- * @example
- * (42).must.be.at.most(69)
- * (42).must.be.at.most(42)
- *
- * @method most
- * @param expected
- */
-Must.prototype.most = function(expected) {
- this.assert(this.actual <= expected, "be at most", {expected: expected})
-}
-
-/**
- * @method lte
- * @alias most
- */
-Must.prototype.lte = Must.prototype.most
-
-/**
- * Assert that an object is above and greater than (`>`) `expected`.
- * Uses `>` for comparison, so it'll also work with value objects (those
- * implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
- *
- * @example
- * (69).must.be.above(42)
- *
- * @method above
- * @param expected
- */
-Must.prototype.above = function(expected) {
- this.assert(this.actual > expected, "be above", {expected: expected})
-}
-
-/**
- * @method gt
- * @alias above
- */
-Must.prototype.gt = Must.prototype.above
-
-/**
- * Works well with dates where saying *after* is more natural than *above* or
- * *greater than*.
- *
- * To assert that a date is equivalent to another date, use
- * [`eql`](#Must.prototype.eql). For regular numbers,
- * [`equal`](#Must.prototype.equal) is fine.
- *
- * @example
- * (1337).must.be.after(42)
- * new Date(2030, 5, 18).must.be.after(new Date(2013, 9, 23))
- *
- * @method after
- * @alias above
- */
-Must.prototype.after = Must.prototype.above
-
-/**
- * Assert that an object is at least, greater than or equal to (`>=`),
- * `expected`.
- * Uses `>=` for comparison, so it'll also work with value objects (those
- * implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
- *
- * @example
- * (69).must.be.at.least(42)
- * (42).must.be.at.least(42)
- *
- * @method least
- * @param expected
- */
-Must.prototype.least = function(expected) {
- this.assert(this.actual >= expected, "be at least", {expected: expected})
-}
-
-/**
- * @method gte
- * @alias least
- */
-Must.prototype.gte = Must.prototype.least
-
-/**
- * Assert that an object is between `begin` and `end` (inclusive).
- * Uses `<` for comparison, so it'll also work with value objects (those
- * implementing [`valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)) like `Date`.
- *
- * @example
- * (13).must.be.between(13, 69)
- * (42).must.be.between(13, 69)
- * (69).must.be.between(13, 69)
- *
- * @method between
- * @param begin
- * @param end
- */
-Must.prototype.between = function(begin, end) {
- this.assert(begin <= this.actual && this.actual <= end, function() {
- return "be between " + stringify(begin) + " and " + stringify(end)
- })
-}
-/**
- * Makes any matcher following the use of `resolve` wait till a promise
- * resolves before asserting.
- * Returns a new promise that will either resolve if the assertion passed or
- * fail with `AssertionError`.
- *
- * Promises are transparent to matchers, so everything will also work with
- * customer matchers you've added to `Must.prototype`. Internally Must just
- * waits on the promise and calls the matcher function once it's resolved.
- *
- * With [Mocha](http://mochajs.org), using this will look something like:
- *
- * ```javascript
- * it("must pass", function() {
- * return Promise.resolve(42).must.resolve.to.equal(42)
- * })
- * ```
- *
- * Using [CoMocha](https://github.com/blakeembrey/co-mocha), it'll look like:
- * ```javascript
- * it("must pass", function*() {
- * yield Promise.resolve(42).must.resolve.to.equal(42)
- * yield Promise.resolve([1, 2, 3]).must.resolve.to.not.include(42)
- * })
- * ```
- *
- * @example
- * Promise.resolve(42).must.resolve.to.equal(42)
- * Promise.resolve([1, 2, 3]).must.resolve.to.not.include(42)
- *
- * @property resolve
- * @on prototype
- */
-defineGetter(Must.prototype, "resolve", function() {
- return Resolvable(this)
-})
-
-/**
- * @example
- * Promise.resolve(42).must.then.equal(42)
- *
- * @property then
- * @on prototype
- * @alias resolve
- */
-defineGetter(Must.prototype, "then", lookupGetter(Must.prototype, "resolve"))
-
-/**
- * @example
- * Promise.resolve(42).must.eventually.equal(42)
- *
- * @property eventually
- * @on prototype
- * @alias resolve
- */
-defineGetter(Must.prototype, "eventually",
- lookupGetter(Must.prototype, "resolve"))
-
-/**
- * Makes any matcher following the use of `reject` wait till a promise
- * is rejected before asserting.
- * Returns a new promise that will either resolve if the assertion passed or
- * fail with `AssertionError`.
- *
- * Promises are transparent to matchers, so everything will also work with
- * customer matchers you've added to `Must.prototype`. Internally Must just
- * waits on the promise and calls the matcher function once it's rejected.
- *
- * With [Mocha](http://mochajs.org), using this will look something like:
- *
- * ```javascript
- * it("must pass", function() {
- * return Promise.reject(42).must.reject.to.equal(42)
- * })
- * ```
- *
- * Using [CoMocha](https://github.com/blakeembrey/co-mocha), it'll look like:
- * ```javascript
- * it("must pass", function*() {
- * yield Promise.reject(42).must.reject.to.equal(42)
- * yield Promise.reject([1, 2, 3]).must.reject.to.not.include(42)
- * })
- * ```
- *
- * @example
- * Promise.reject(42).must.reject.to.equal(42)
- * Promise.reject([1, 2, 3]).must.reject.to.not.include(42)
- *
- * @property reject
- * @on prototype
- */
-defineGetter(Must.prototype, "reject", function() {
- return Rejectable(this)
-})
-
-/**
- * Assert a string starts with the given string.
- *
- * @example
- * "Hello, John".must.startWith("Hello")
- *
- * @method startWith
- * @param expected
- */
-Must.prototype.startWith = function(expected) {
- var ok = startsWith(this.actual, expected)
- this.assert(ok, "start with", {expected: expected})
-}
-
-/**
- * Pass-through property for a fluent chain.
- *
- * @example
- * Promise.resolve(42).must.resolve.with.number()
- *
- * @property with
- * @on prototype
- */
-defineGetter(Must.prototype, "with", passthrough)
-
-Must.prototype.assert = function assert(ok, message, opts) {
- if (!this.negative ? ok : !ok) return
-
- opts = opts ? Object.create(opts) : {}
- if (!("actual" in opts)) opts.actual = this.actual
-
- if (!("caller" in opts)) {
- // Accessing caller in strict mode throws TypeError.
- try { opts.caller = assert.caller }
- catch (ex) { opts.caller = assert }
- }
-
- var msg = stringify(this.actual) + " must " + (this.negative ? "not " : "")
- if (typeof message == "function") msg += message.call(this)
- else msg += message + ("expected" in opts ? " "+stringify(opts.expected) : "")
- if (this.message != null) msg = this.message + ": " + msg
-
- throw new AssertionError(msg, opts)
-}
-
-Object.defineProperty(Must.prototype, "assert", {enumerable: false})
-
-function eql(a, b) {
- if (egal(a, b)) return true
-
- var type = kindofPlain(a)
- if (type !== kindofPlain(b)) return false
- if (isNumber(a) && isNumber(b) && isNaN(+a) && isNaN(+b)) return true
-
- switch (type) {
- case "array":
- case "plain":
- return null
-
- case "object":
- if (getConstructorOf(a) !== getConstructorOf(b)) return false
- if (hasValueOf(a) && hasValueOf(b)) return false
- return null
-
- default: return false
- }
-}
-
-function getConstructorOf(obj) {
- var prototype = Object.getPrototypeOf(obj)
- return prototype === null ? undefined : prototype.constructor
-}
-
-function hasValueOf(obj) {
- var valueOf = obj.valueOf
- return typeof valueOf === "function" && valueOf !== Object.prototype.valueOf
-}
-
-function kindofPlain(obj) {
- var type = kindof(obj)
- if (type === "object" && O.isPlainObject(obj)) return "plain"
- return type
-}
-
-function isError(err, constructor, expected) {
- if (constructor != null && !(err instanceof constructor)) return false
- if (expected === ANY) return true
-
- switch (kindof(expected)) {
- case "string": return messageFromError(err) === expected
- case "regexp": return expected.exec(messageFromError(err))
- default: return err === expected
- }
-}
-
-function messageFromError(err) {
- // The message in new Error(message) gets converted to a string.
- return err == null || typeof err == "string" ? err : err.message
-}
-
-function isFn(fn) { return typeof fn === "function" }
-function isNumber(n) { return typeof n === "number" || n instanceof Number }
-function passthrough() { return this }
diff --git a/must/package.json b/must/package.json
deleted file mode 100644
index a1d1629..0000000
--- a/must/package.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "name": "must",
- "version": "0.13.4",
- "description": "Testing and assertion library with friendly BDD syntax — awesome.must.be.true(). Many expressive matchers and is test runner and framework agnostic. Follows RFC 2119 with its use of MUST. Good and well tested stuff.",
- "keywords": ["assert", "assertion", "bdd", "test", "testing", "rfc2119"],
- "homepage": "https://github.com/moll/js-must",
- "bugs": "https://github.com/moll/js-must/issues",
-
- "author": {
- "name": "Andri Möll",
- "email": "andri@dot.ee",
- "url": "http://themoll.com"
- },
-
- "typings": "./must.d.ts",
-
- "repository": {
- "type": "git",
- "url": "git://github.com/moll/js-must.git"
- },
-
- "licenses" : [{
- "type" : "LAGPL",
- "url": "https://github.com/moll/js-must/blob/master/LICENSE"
- }],
-
- "main": "register.js",
- "scripts": {"test": "make test"},
-
- "dependencies": {
- "kindof": ">= 2.0.0 < 3",
- "egal": ">= 1.3.0 < 2",
- "oolong": ">= 1.11.0 < 2",
- "lodash.wrap": ">= 3 < 4",
- "json-stringify-safe": ">= 5 < 6"
- },
-
- "devDependencies": {
- "mocha": ">= 2 < 3",
- "promise": ">= 7 < 8",
- "lodash": ">= 3 < 4"
- }
-}
diff --git a/must/register.js b/must/register.js
deleted file mode 100644
index 97a4a53..0000000
--- a/must/register.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var Must = module.exports = require("./must")
-/* eslint no-extend-native: 0 */
-
-/**
- * Creates an instance of [`Must`](#Must) with the current object for asserting
- * and calling matchers on.
- *
- * This property is non-enumerable just like built-in properties, so
- * it'll never interfere with any regular usage of objects.
- *
- * Please note that JavaScript does not allow method calls on `null` or
- * `undefined`, so you'll sometimes have to call [`Must`](#Must) on them by
- * hand. Assigning `require("must")` to `expect` or `demand` works well with
- * those cases.
- *
- * @example
- * true.must.be.true()
- * [].must.be.empty()
- *
- * @property must
- * @for Object
- * @on prototype
- */
-Object.defineProperty(Object.prototype, "must", {
- get: function() { "use strict"; return new Must(this) },
-
- set: function(value) {
- Object.defineProperty(this, "must", {
- value: value,
- configurable: true,
- enumrable: true,
- writable: true
- })
- },
-
- // Without configurable, can't redefine it when reloading this file, e.g.
- configurable: true
-})
diff --git a/must/test/assertion_error_test.js b/must/test/assertion_error_test.js
deleted file mode 100644
index 0a4cb18..0000000
--- a/must/test/assertion_error_test.js
+++ /dev/null
@@ -1,100 +0,0 @@
-var O = require("oolong")
-var assert = require("assert")
-var AssertionError = require("..").AssertionError
-
-describe("AssertionError", function() {
- it("must be named \"AssertionError\"", function() {
- var error = new AssertionError("foo")
- assert.strictEqual(error.name, "AssertionError")
- })
-
- it("must have a constructor property", function() {
- assert.strictEqual(new AssertionError().constructor, AssertionError)
- })
-
- it("must have constructor as a non-enumerable property", function() {
- var error = new AssertionError
- for (var key in error) assert.notEqual(key, "constructor")
- })
-
- it("must have name", function() {
- assert.strictEqual(AssertionError.name, "AssertionError")
- })
-
- describe("new", function() {
- it("must be an instance of AssertionError", function() {
- var error = new AssertionError("foo")
- assert(error instanceof AssertionError)
- })
-
- it("must be an instance of Error", function() {
- var error = new AssertionError("foo")
- assert(error instanceof Error)
- })
-
- it("must set actual if given", function() {
- var actual = {}
- var error = new AssertionError("", {actual: actual})
- assert.strictEqual(error.actual, actual)
- })
-
- it("must not set actual if not given", function() {
- var error = new AssertionError("")
- assert(!("actual" in error))
- })
-
- it("must set expected if given", function() {
- var expected = {}
- var error = new AssertionError("", {expected: expected})
- assert.strictEqual(error.expected, expected)
- })
-
- it("must not set expected if not given", function() {
- var error = new AssertionError("")
- assert(!("expected" in error))
- })
-
- it("must set diffable if given", function() {
- var error = new AssertionError("", {diffable: true})
- assert.strictEqual(error.diffable, true)
- })
-
- it("must not set diffable if not given", function() {
- var error = new AssertionError("")
- assert(!("diffable" in error))
- })
- })
-
- describe(".prototype.showDiff", function() {
- it("must return the value of diffable", function() {
- var diffable = new AssertionError("", {diffable: true})
- assert.strictEqual(diffable.showDiff, true)
-
- var undiffable = new AssertionError("", {diffable: false})
- assert.strictEqual(undiffable.showDiff, false)
- })
- })
-
- describe(".prototype.stack", function() {
- it("must be unenumerable", function() {
- assert(O.keys(new AssertionError("Misery")).indexOf("assert") == -1)
- })
-
- it("must be unenumerable if given", function() {
- var err = new AssertionError("Misery", {stack: "Problem at line 42"})
- assert(O.keys(err).indexOf("assert") == -1)
- })
-
- it("must use given stack and replace first line", function() {
- var a = new Error
- var b = new AssertionError("Misery", {stack: a.stack})
-
- var aStackLines = a.stack.split(/\r?\n/)
- var bStackLines = b.stack.split(/\r?\n/)
-
- aStackLines.shift()
- bStackLines.shift().must.include("AssertionError: Misery")
- assert.deepEqual(aStackLines, bStackLines)
- })
- })
-})
diff --git a/must/test/lib/index_test.js b/must/test/lib/index_test.js
deleted file mode 100644
index b770f43..0000000
--- a/must/test/lib/index_test.js
+++ /dev/null
@@ -1,188 +0,0 @@
-var assert = require("assert")
-var stringify = require("../..").stringify
-var describeSymbol = typeof Symbol != "undefined" ? describe : xdescribe
-var itSymbol = typeof Symbol != "undefined" ? it : xit
-var INDENT = null
-
-describe("Must.stringify", function() {
- it("must return undefined", function() {
- assert.strictEqual(stringify(undefined), "undefined")
- })
-
- it("must return null", function() {
- assert.strictEqual(stringify(null), "null")
- })
-
- describe("given Number", function() {
- it("must stringify 42 as 42", function() {
- assert.strictEqual(stringify(42), "42")
- })
-
- it("must stringify Infinity as Infinity", function() {
- assert.strictEqual(stringify(Infinity), "Infinity")
- })
-
- it("must stringify -Infinity as -Infinity", function() {
- assert.strictEqual(stringify(-Infinity), "-Infinity")
- })
-
- it("must stringify NaN as NaN", function() {
- assert.strictEqual(stringify(NaN), "NaN")
- })
- })
-
- describe("given String", function() {
- it("must stringify quoted", function() {
- assert.strictEqual(stringify("Hello, world!"), "\"Hello, world!\"")
- })
- })
-
- describeSymbol("given Symbol", function() {
- it("must stringify a named symbol", function() {
- var symbol = Symbol("iterator")
- assert.strictEqual(stringify(symbol), "Symbol(iterator)")
- })
-
- it("must stringify an unnamed symbol", function() {
- var symbol = Symbol()
- assert.strictEqual(stringify(symbol), "Symbol()")
- })
- })
-
- describe("given Date", function() {
- it("must stringify ISO string representation", function() {
- var date = new Date(Date.UTC(1987, 5, 18, 2))
- assert.strictEqual(stringify(date), "1987-06-18T02:00:00.000Z")
- })
- })
-
- describe("given RegExp", function() {
- it("must stringify source with flags", function() {
- var regexp = /abc[de]./i
- assert.strictEqual(stringify(regexp), "/abc[de]./i")
- })
- })
-
- describe("given Function", function() {
- it("must stringify source", function() {
- function awesome() { return 42 }
- assert.strictEqual(stringify(awesome), "function awesome() { return 42 }")
- })
- })
-
- describe("given Array", function() {
- it("must stringify recursively", function() {
- var array = [{cool: 42}]
- assert.strictEqual(stringify(array), jsonify(array))
- })
-
- it("must stringify circular objects", function() {
- var array = [{name: "John"}, {name: "Mark"}]
- array[0].self = array[0]
-
- assert.strictEqual(stringify(array), jsonify([
- {name: "John", self: "[Circular ~.0]"},
- {name: "Mark"}
- ]))
- })
-
- it("must stringify with toJSON", function() {
- var array = [{toJSON: function() { return 42 }}]
- assert.strictEqual(stringify(array), jsonify([42]))
- })
- })
-
- describe("given Object", function() {
- it("must stringify recursively", function() {
- var obj = {a: {cool: 42}}
- assert.strictEqual(stringify(obj), jsonify(obj))
- })
-
- it("must stringify inherited properties", function() {
- var obj = Object.create({a: 42})
- assert.strictEqual(stringify(obj), jsonify({a: 42}))
- })
-
- it("must stringify circular objects", function() {
- var obj = {name: "John", likes: {sex: true}}
- obj.self = obj
-
- assert.strictEqual(stringify(obj), jsonify({
- name: "John",
- likes: {sex: true},
- self: "[Circular ~]"
- }))
- })
-
- it("must stringify nested circular objects", function() {
- var obj = {name: "John", likes: {}}
- obj.likes.likes = obj.likes
- var str = jsonify({name: "John", likes: {likes: "[Circular ~.likes]"}})
- assert.strictEqual(stringify(obj), str)
- })
-
- it("must stringify circular arrays", function() {
- var obj = [1, 2, 3]
- obj.push(obj)
- obj.push(5)
- assert.strictEqual(stringify(obj), jsonify([1, 2, 3, "[Circular ~]", 5]))
- })
-
- it("must stringify circular inherited objects", function() {
- var obj = Object.create({name: "John"})
- obj.self = obj
- var str = jsonify({self: "[Circular ~]", name: "John"})
- assert.strictEqual(stringify(obj), str)
- })
-
- it("must stringify undefined values", function() {
- var obj = {name: "John", age: undefined}
- var str = jsonify({name: "John", age: "[Undefined]"})
- assert.strictEqual(stringify(obj), str)
- })
-
- it("must stringify NaN", function() {
- var obj = {age: NaN}
- var str = jsonify({age: "[NaN]"})
- assert.strictEqual(stringify(obj), str)
- })
-
- it("must stringify with toJSON", function() {
- var obj = {age: {toJSON: function() { return 42 }}}
- assert.strictEqual(stringify(obj), jsonify({age: 42}))
- })
-
- itSymbol("must stringify nested Symbol", function() {
- var obj = {name: "John", type: Symbol("person")}
- var str = jsonify({name: "John", type: "Symbol(person)"})
- assert.strictEqual(stringify(obj), str)
- })
-
- it("must stringify nested RegExp", function() {
- var obj = {name: "John", match: /tinder/i}
- var str = jsonify({name: "John", match: "/tinder/i"})
- assert.strictEqual(stringify(obj), str)
- })
-
- it("must not stringify nested Function", function() {
- var obj = {name: "John", greet: function() {}}
- assert.strictEqual(stringify(obj), jsonify({name: "John"}))
- })
- })
-
- describe("given Error", function() {
- it("must stringify the message", function() {
- var err = new Error("Problem")
- assert.strictEqual(stringify(err), jsonify({message: "Problem"}))
- })
-
- it("must stringify other enumerable properties", function() {
- var err = new Error("Not Found")
- err.code = 404
- var str = jsonify({code: 404, message: "Not Found"})
- assert.strictEqual(stringify(err), str)
- })
- })
-})
-
-function jsonify(obj) { return JSON.stringify(obj, null, INDENT) }
diff --git a/must/test/mocha.opts b/must/test/mocha.opts
deleted file mode 100644
index 9c0f0f9..0000000
--- a/must/test/mocha.opts
+++ /dev/null
@@ -1,2 +0,0 @@
---recursive
---check-leaks
diff --git a/must/test/must/_assertion_error_test.js b/must/test/must/_assertion_error_test.js
deleted file mode 100644
index e8bc153..0000000
--- a/must/test/must/_assertion_error_test.js
+++ /dev/null
@@ -1,23 +0,0 @@
-var Must = require("../..")
-var assert = require("assert")
-
-module.exports = function(test, props) {
- describe("AssertionError", function() {
- it("must be thrown", function() {
- assert.throws(test, Must.AssertionError)
- })
-
- it("must have all properties", function() {
- try { test() } catch (ex) { assert.deepEqual(ex, props) }
- })
-
- it("must have correct stack trace", function() {
- try { test() }
- catch (ex) {
- var stack = ex.stack.split(/\r?\n/)
- assert(stack[0].match(/AssertionError/, "must include AssertionError"))
- assert(stack[1].match(/[\\\/]test[\\\/]/), "must have test at top")
- }
- })
- })
-}
diff --git a/must/test/must/_boolean_test.js b/must/test/must/_boolean_test.js
deleted file mode 100644
index 759a4d6..0000000
--- a/must/test/must/_boolean_test.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-module.exports = function(name, truthy) {
- // Allow using new Boolean:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
- var pass = truthy ? "pass" : "fail"
- var fail = truthy ? "fail" : "pass"
- var throws = truthy ? assert.fail : assert.pass
- var doesNotThrow = truthy ? assert.pass : assert.fail
-
- it("must "+pass+" given true primitive", function() {
- doesNotThrow(function() { Must(true).be[name]() })
- })
-
- it("must fail given true object", function() {
- assert.fail(function() { Must(new Boolean(true)).be[name]() })
- })
-
- it("must "+fail+" given false primitive", function() {
- throws(function() { Must(false).be[name]() })
- })
-
- it("must fail given false object", function() {
- assert.fail(function() { Must(new Boolean(false)).be[name]() })
- })
-
- it("must fail gracefully if null", function() {
- assert.fail(function() { Must(null).be[name]() })
- })
-
- it("must fail gracefully if undefined", function() {
- assert.fail(function() { Must(undefined).be[name]() })
- })
-
- it("must fail given zero number primitive", function() {
- assert.fail(function() { Must(0).be[name]() })
- })
-
- it("must fail given an empty string", function() {
- assert.fail(function() { Must("").be[name]() })
- })
-
- require("./_assertion_error_test")(function() { Must(!truthy).be[name]() }, {
- actual: !truthy,
- expected: truthy,
- message: !truthy + " must be " + truthy
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(truthy).not.be[name]() })
- })
- })
-}
diff --git a/must/test/must/_enumerable_test.js b/must/test/must/_enumerable_test.js
deleted file mode 100644
index 620b038..0000000
--- a/must/test/must/_enumerable_test.js
+++ /dev/null
@@ -1,124 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-module.exports = function(name, truthy) {
- var pass = truthy ? "pass" : "fail"
- var fail = truthy ? "fail" : "pass"
- var throws = truthy ? assert.fail : assert.pass
- var doesNotThrow = truthy ? assert.pass : assert.fail
-
- it("must "+pass+" if property is enumerable", function() {
- var obj = {love: true}
- doesNotThrow(function() { Must(obj).have[name]("love") })
- })
-
- it("must "+pass+" if inherited property is enumerable", function() {
- function Fn() {}
- Fn.prototype.love = 69
- doesNotThrow(function() { Must(new Fn()).have[name]("love") })
- })
-
- it("must "+fail+" if property is nonenumerable", function() {
- var obj = Object.create(Object.prototype, {
- love: {value: 69, enumerable: false},
- })
- throws(function() { Must(obj).have[name]("love") })
- })
-
- it("must "+fail+" if inherited property is nonenumerable", function() {
- function Fn() {}
- Fn.prototype = Object.create(Object.prototype, {
- love: {value: 69, enumerable: false},
- })
- throws(function() { Must(new Fn()).have[name]("love") })
- })
-
- it("must "+pass+" if function's property is enumerable", function() {
- function fn() {}
- fn.love = 69
- doesNotThrow(function() { Must(fn).have[name]("love") })
- })
-
- it("must "+fail+" if function's property is nonenumerable", function() {
- function fn() {}
- Object.defineProperty(fn, "love", {value: 69, enumerable: false})
- throws(function() { Must(fn).have[name]("love") })
- })
-
- afterEach(function() { delete String.prototype.life })
-
- it("must "+pass+" if String.prototype's property is enumerable",
- function() {
- /* eslint no-extend-native: 0 */
- String.prototype.life = 42
- doesNotThrow(function() { Must("Hello").have[name]("life") })
- })
-
- it("must "+fail+" if String.prototype's property is nonenumerable",
- function() {
- Object.defineProperty(String.prototype, "life", {
- value: 42, enumerable: false, configurable: true
- })
- throws(function() { Must("Hello").have[name]("life") })
- })
-
- afterEach(function() { delete Boolean.prototype.life })
-
- it("must "+pass+" if false's Boolean.prototype's property is enumerable",
- function() {
- Boolean.prototype.life = 42
- doesNotThrow(function() { Must(false).have[name]("life") })
- })
-
- it("must "+fail+" if false's Boolean.prototype's property is nonenumerable",
- function() {
- Object.defineProperty(Boolean.prototype, "life", {
- value: 42, enumerable: false, configurable: true
- })
- throws(function() { Must(false).have[name]("life") })
- })
-
- it("must fail if property does not exist", function() {
- assert.fail(function() { Must({}).have[name]("love") })
- })
-
- it("must pass if object has "+name+" property named \"propertyIsEnumerable\"",
- function() {
- var obj = Object.create(Object.prototype, {
- propertyIsEnumerable: {value: false, enumerable: truthy}
- })
- assert.pass(function() {
- Must(obj).have[name]("propertyIsEnumerable")
- })
- })
-
- it("must fail gracefully if null", function() {
- assert.fail(function() { Must(null).have[name]("love") })
- })
-
- it("must fail gracefully if undefined", function() {
- assert.fail(function() { Must(undefined).have[name]("love") })
- })
-
- var errObj = Object.create(Object.prototype, {
- life: {value: 42, enumerable: true},
- love: {value: 69, enumerable: false},
- })
-
- var errProp = truthy ? "love" : "life"
-
- require("./_assertion_error_test")(function() {
- Must(errObj).have[name](errProp)
- }, {
- actual: {life: 42},
- message: "{\"life\":42} must have "+name+" property \""+errProp+"\""
- })
-
- describe(".not", function() {
- var errProp = truthy ? "life" : "love"
-
- it("must invert the assertion", function() {
- assert.fail(function() { Must(errObj).not.have[name](errProp) })
- })
- })
-}
diff --git a/must/test/must/_error_test.js b/must/test/must/_error_test.js
deleted file mode 100644
index 4eedd4d..0000000
--- a/must/test/must/_error_test.js
+++ /dev/null
@@ -1,93 +0,0 @@
-var _ = require("lodash")
-var Must = require("../..")
-var assert = require("./assert")
-
-module.exports = function(name, actualize) {
- var create = _.compose(Must, actualize)
-
- describe("as an error matcher", function() {
- describe("given String", function() {
- it("must pass given error with identical message", function() {
- assert.pass(function() { create(new Error("Oh no!"))[name]("Oh no!") })
- })
-
- it("must fail given error with part of identical message",
- function() {
- assert.fail(function() { create(new Error("Oh no!"))[name]("Oh no") })
- })
-
- it("must fail given error with unequivalent message", function() {
- assert.fail(function() { create(new Error("Oh no!"))[name]("Oh yes!") })
- })
- })
-
- describe("given RegExp", function() {
- it("must pass given error with matching message", function() {
- assert.pass(function() { create(new Error("Oh no!"))[name](/no!/) })
- })
-
- it("must fail given error with unmatching message", function() {
- assert.fail(function() { create(new Error("Oh no!"))[name](/yes!/) })
- })
- })
-
- describe("given Function", function() {
- // Intentionally do not subclass FakeError from Error.
- function FakeError(msg) { this.message = msg == null ? "" : msg }
- FakeError.prototype.message = ""
-
- it("must pass given error instance of function", function() {
- assert.pass(function() { create(new FakeError)[name](FakeError) })
- })
-
- it("must pass given error child instance of function", function() {
- assert.pass(function() { create(new TypeError)[name](Error) })
- })
-
- it("must fail given error instance of other function", function() {
- assert.fail(function() { create(new Error)[name](FakeError) })
- })
-
- it("must fail given error parent instance of function", function() {
- assert.fail(function() { create(new Error)[name](TypeError) })
- })
-
- describe("with String", function() {
- var err = new TypeError("Oh no!")
-
- it("must pass given error with identical message", function() {
- assert.pass(function() { create(err)[name](TypeError, "Oh no!") })
- })
-
- it("must fail given error other instance", function() {
- assert.fail(function() { create(err)[name](RangeError, "Oh no!") })
- })
-
- it("must fail given error with part of identical message",
- function() {
- assert.fail(function() { create(err)[name](TypeError, "Oh no") })
- })
-
- it("must fail given error with unequivalent message", function() {
- assert.fail(function() { create(err)[name](TypeError, "Oh yes!") })
- })
- })
-
- describe("with RegExp", function() {
- var err = new TypeError("Oh no!")
-
- it("must pass given error with matching message", function() {
- assert.pass(function() { create(err)[name](TypeError, /no!/) })
- })
-
- it("must fail given error other instance", function() {
- assert.fail(function() { create(err)[name](RangeError, /no!/) })
- })
-
- it("must fail given error with unmatching message", function() {
- assert.fail(function() { create(err)[name](TypeError, /yes!/) })
- })
- })
- })
- })
-}
diff --git a/must/test/must/_keys_test.js b/must/test/must/_keys_test.js
deleted file mode 100644
index c3a578a..0000000
--- a/must/test/must/_keys_test.js
+++ /dev/null
@@ -1,108 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-module.exports = function(name, inheritable) {
- var pass = inheritable ? "pass" : "fail"
- var fail = inheritable ? "fail" : "pass"
- var throws = inheritable ? assert.fail : assert.pass
- var doesNotThrow = inheritable ? assert.pass : assert.fail
-
- it("must pass given an object with expected own keys", function() {
- assert.pass(function() { Must({a: 1, b: 2}).have[name](["a", "b"]) })
- })
-
- it("must pass given an object with zero keys", function() {
- assert.pass(function() { Must({}).have[name]([]) })
- })
-
- it("must fail given zero and non-zero number of keys", function() {
- assert.fail(function() { Must({}).have[name](["a"]) })
- assert.fail(function() { Must({a: 1}).have[name]([]) })
- })
-
- it("must fail given a different amount of keys", function() {
- assert.fail(function() { Must({a: 1}).have[name](["a", "b"]) })
- assert.fail(function() { Must({a: 1, b: 2}).have[name](["a"]) })
- })
-
- it("must not modify given array", function() {
- var keys = ["name", "age"]
- Must({name: "John", age: 13}).have[name](keys)
- assert.deepEqual(keys, ["name", "age"])
- })
-
- describe("given an inherited object", function() {
- it("must "+pass+" given an object with inherited expected keys",
- function() {
- var obj = Object.create({a: 1, b: 2})
- doesNotThrow(function() { Must(obj).have[name](["a", "b"]) })
- })
-
- it("must "+pass+" given an object with some expected keys inherited",
- function() {
- var obj = Object.create({a: 1}, {b: {value: 2, enumerable: true}})
- doesNotThrow(function() { Must(obj).have[name](["a", "b"]) })
- })
-
- it("must "+fail+" given an object with all expected keys as own",
- function() {
- var obj = Object.create({a: 1}, {b: {value: 2, enumerable: true}})
- throws(function() { Must(obj).have[name](["b"]) })
- })
-
- it("must "+fail+" given an object with zero own keys", function() {
- throws(function() { Must(Object.create({a: 1})).have[name]([]) })
- })
-
- it("must fail given a different amount of keys", function() {
- assert.fail(function() {
- Must(Object.create({a: 1})).have[name](["a", "b"])
- })
- assert.fail(function() {
- Must(Object.create({a: 1, b: 2})).have[name](["a"])
- })
- })
- })
-
- it("must pass if function has key", function() {
- function fn() {}
- fn.love = 69
- assert.pass(function() { Must(fn).have[name](["love"]) })
- })
-
- it("must "+pass+" if function has inherited key", function() {
- function fn() {}
- /* eslint no-proto: 0 */
- var obj = {love: {value: 1, enumerable: 1}}
- fn.__proto__ = Object.create(fn.__proto__, obj)
- doesNotThrow(function() { Must(fn).have[name](["love"]) })
- })
-
- afterEach(function() { delete Number.prototype.life })
-
- it("must "+pass+" if Number.prototype has inherited key", function() {
- /* eslint no-extend-native: 0 */
- Object.defineProperty(Number.prototype, "life", {
- value: 42, enumerable: true, configurable: true
- })
- doesNotThrow(function() { Must(42).have[name](["life"]) })
- })
-
- afterEach(function() { delete Boolean.prototype.life })
-
- it("must "+pass+" if false's Boolean.prototype has property", function() {
- /* eslint no-extend-native: 0 */
- Object.defineProperty(Boolean.prototype, "life", {
- value: 42, enumerable: true, configurable: true
- })
- doesNotThrow(function() { Must(false).have[name](["life"]) })
- })
-
- it("must fail gracefully if null", function() {
- assert.fail(function() { Must(null).have[name](["love"]) })
- })
-
- it("must fail gracefully if undefined", function() {
- assert.fail(function() { Must(undefined).have[name](["love"]) })
- })
-}
diff --git a/must/test/must/_properties_test.js b/must/test/must/_properties_test.js
deleted file mode 100644
index 7eb4a6b..0000000
--- a/must/test/must/_properties_test.js
+++ /dev/null
@@ -1,105 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-module.exports = function(name, inheritable) {
- // Allow using new Number:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
- var pass = inheritable ? "pass" : "fail"
- var doesNotThrow = inheritable ? assert.pass : assert.fail
- var errName = name.replace(/[A-Z]/, function(l) {return " "+l.toLowerCase()})
-
- it("must pass if object is superset of given properties", function() {
- var obj = {name: "John", age: 42, sex: "male"}
- var props = {name: "John", age: 42}
- assert.pass(function() { Must(obj).have[name](props) })
- })
-
- it("must pass if object has all given properties", function() {
- var a = {name: "John", age: 42, sex: "male"}
- var b = {name: "John", age: 42, sex: "male"}
- assert.pass(function() { Must(a).have[name](b) })
- })
-
- it("must pass if given no properties", function() {
- assert.pass(function() { Must({name: "John"}).have[name]({}) })
- })
-
- it("must "+pass+" if object has inherited propertes", function() {
- var obj = Object.create({name: "John"})
- obj.age = 42
- obj.sex = "male"
- var props = {name: "John", age: 42}
- doesNotThrow(function() { Must(obj).have[name](props) })
- })
-
- it("must pass if given an object with an undefined property", function() {
- var obj = {name: "John", age: 42, sex: undefined}
- var props = {name: "John", sex: undefined}
- assert.pass(function() { Must(obj).have[name](props) })
- })
-
- it("must "+pass+" if object has inherited property as undefined", function() {
- var obj = Object.create({name: "John", age: undefined})
- obj.sex = "male"
- var props = {age: undefined, sex: "male"}
- doesNotThrow(function() { Must(obj).have[name](props) })
- })
-
- it("must fail if one property missing", function() {
- var obj = {name: "John", sex: "male"}
- var props = {name: "John", age: 42}
- assert.fail(function() { Must(obj).have[name](props) })
- })
-
- // Catches whether the last property check overwrites all previous ones.
- it("must fail if only last given property set", function() {
- var obj = {name: "John", age: 42, sex: "male"}
- var props = {name: "Jake", sex: "male"}
- assert.fail(function() { Must(obj).have[name](props) })
- })
-
- it("must fail if object has one with an equivalent value", function() {
- var obj = {name: "John", age: 42, sex: "male"}
- var props = {name: "John", age: new Number(42)}
- assert.fail(function() { Must(obj).have[name](props) })
- })
-
- it("must fail if an undefined property missing", function() {
- var obj = {name: "John", age: 42}
- var props = {name: "John", sex: undefined}
- assert.fail(function() { Must(obj).have[name](props) })
- })
-
- it("must fail if object empty", function() {
- var props = {name: "John", age: 42}
- assert.fail(function() { Must({}).have[name](props) })
- })
-
- it("must fail gracefully if null", function() {
- assert.fail(function() { Must(null).have[name]({}) })
- })
-
- it("must fail gracefully if undefined", function() {
- assert.fail(function() { Must(undefined).have[name]({}) })
- })
-
- require("./_assertion_error_test")(function() {
- var obj = {name: "John", sex: "male"}
- var props = {name: "John", age: 42}
- Must(obj).have[name](props)
- }, {
- actual: {name: "John", sex: "male"},
- expected: {name: "John", age: 42},
- diffable: true,
- message: "{\"name\":\"John\",\"sex\":\"male\"} must have "+errName+" {\"name\":\"John\",\"age\":42}"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- var obj = {name: "John", age: 42, sex: "male"}
- var props = {name: "John", age: 42}
- assert.fail(function() { Must(obj).not.have[name](props) })
- })
- })
-}
diff --git a/must/test/must/_property_test.js b/must/test/must/_property_test.js
deleted file mode 100644
index 7d2149f..0000000
--- a/must/test/must/_property_test.js
+++ /dev/null
@@ -1,142 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-module.exports = function(name, inheritable) {
- // Allow using new Number:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
- var pass = inheritable ? "pass" : "fail"
- var doesNotThrow = inheritable ? assert.pass : assert.fail
- var errName = name.replace(/[A-Z]/, function(l) {return " "+l.toLowerCase()})
-
- describe("given name", function() {
- it("must pass if object has property", function() {
- assert.pass(function() { Must({love: 69}).have[name]("love") })
- })
-
- it("must "+pass+" if object has inherited property", function() {
- var obj = Object.create({love: 69})
- doesNotThrow(function() { Must(obj).have[name]("love") })
- })
-
- it("must fail if object doesn't have property", function() {
- assert.fail(function() { Must({}).have[name]("love") })
- })
-
- it("must pass if object has property as undefined", function() {
- assert.pass(function() {
- Must({love: undefined}).have[name]("love")
- })
- })
-
- it("must "+pass+" if object has inherited property as undefined",
- function() {
- var obj = Object.create({love: undefined})
- doesNotThrow(function() { Must(obj).have[name]("love") })
- })
-
- require("./_assertion_error_test")(function() {
- Must({name: "John"}).have[name]("age")
- }, {
- actual: {name: "John"},
- message: "{\"name\":\"John\"} must have "+errName+" \"age\""
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must({name: "John"}).not.have[name]("name") })
- })
- })
- })
-
- describe("given name and value", function() {
- it("must pass if object has property with identical value", function() {
- assert.pass(function() {
- Must({love: 69}).have[name]("love", 69)
- })
- })
-
- it("must "+pass+" if object has inherited property with identical value",
- function() {
- var obj = Object.create({love: 69})
- doesNotThrow(function() { Must(obj).have[name]("love", 69) })
- })
-
- it("must fail if object doesn't have property", function() {
- assert.fail(function() { Must({}).have[name]("love", 69) })
- })
-
- it("must fail if object has property with equivalent value", function() {
- assert.fail(function() {
- Must({love: 69}).have[name]("love", new Number(69))
- })
- })
-
- it("must pass if object has property asserted undefined", function() {
- assert.pass(function() {
- Must({love: undefined}).have[name]("love", undefined)
- })
- })
-
- it("must "+pass+" if object has inherited property asserted undefined",
- function() {
- var obj = Object.create({love: undefined})
- doesNotThrow(function() { Must(obj).have[name]("love", undefined) })
- })
-
- require("./_assertion_error_test")(function() {
- Must({age: 13}).have[name]("age", 42)
- }, {
- actual: {age: 13},
- expected: 42,
- message: "{\"age\":13} must have "+errName+" \"age\" equal to 42"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must({age: 42}).not.have[name]("age", 42) })
- })
- })
- })
-
- it("must pass if function has property", function() {
- function fn() {}
- fn.love = 69
- assert.pass(function() { Must(fn).have[name]("love") })
- })
-
- it("must "+pass+" if function has inherited property", function() {
- function fn() {}
- /* eslint no-proto: 0 */
- fn.__proto__ = Object.create(fn.__proto__, {love: {value: 69}})
- doesNotThrow(function() { Must(fn).have[name]("love") })
- })
-
- afterEach(function() { delete String.prototype.life })
-
- it("must "+pass+" if String.prototype has property", function() {
- /* eslint no-extend-native: 0 */
- Object.defineProperty(String.prototype, "life", {
- value: 42, enumerable: false, configurable: true
- })
- doesNotThrow(function() { Must("Hello").have[name]("life") })
- })
-
- afterEach(function() { delete Boolean.prototype.life })
-
- it("must "+pass+" if false's Boolean.prototype has property", function() {
- /* eslint no-extend-native: 0 */
- Object.defineProperty(Boolean.prototype, "life", {
- value: 42, enumerable: false, configurable: true
- })
- doesNotThrow(function() { Must(false).have[name]("life") })
- })
-
- it("must fail gracefully if null", function() {
- assert.fail(function() { Must(null).have[name]("love") })
- })
-
- it("must fail gracefully if undefined", function() {
- assert.fail(function() { Must(undefined).have[name]("love") })
- })
-}
diff --git a/must/test/must/_truthy_test.js b/must/test/must/_truthy_test.js
deleted file mode 100644
index 0f9e453..0000000
--- a/must/test/must/_truthy_test.js
+++ /dev/null
@@ -1,127 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-module.exports = function(name, truthy) {
- // Allow using new Boolean:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
- var pass = truthy ? "pass" : "fail"
- var fail = truthy ? "fail" : "pass"
- var throws = truthy ? assert.fail : assert.pass
- var doesNotThrow = truthy ? assert.pass : assert.fail
-
- it("must "+fail+" given null", function() {
- throws(function() { Must(null).be[name]() })
- })
-
- it("must "+fail+" given undefined", function() {
- throws(function() { Must(undefined).be[name]() })
- })
-
- describe("given Boolean", function() {
- it("must "+pass+" given true primitive", function() {
- doesNotThrow(function() { Must(true).be[name]() })
- })
-
- it("must "+pass+" given true object", function() {
- doesNotThrow(function() { Must(new Boolean(true)).be[name]() })
- })
-
- it("must "+fail+" given false primitive", function() {
- throws(function() { Must(false).be[name]() })
- })
-
- it("must "+pass+" given false object", function() {
- doesNotThrow(function() { Must(new Boolean(false)).be[name]() })
- })
- })
-
- describe("given Number", function() {
- it("must "+pass+" given primitive", function() {
- doesNotThrow(function() { Must(1).be[name]() })
- })
-
- it("must "+pass+" given object", function() {
- doesNotThrow(function() { Must(new Number(1)).be[name]() })
- })
-
- it("must "+fail+" given zero primitive", function() {
- throws(function() { Must(0).be[name]() })
- })
-
- it("must "+pass+" given zero object", function() {
- doesNotThrow(function() { Must(new Number(0)).be[name]() })
- })
- })
-
- describe("given String", function() {
- it("must "+pass+" given primitive", function() {
- doesNotThrow(function() { Must("truthy").be[name]() })
- })
-
- it("must "+pass+" given object", function() {
- doesNotThrow(function() { Must(new String("truthy")).be[name]() })
- })
-
- it("must "+pass+" given zero primitive", function() {
- doesNotThrow(function() { Must("0").be[name]() })
- })
-
- it("must "+pass+" given zero object", function() {
- doesNotThrow(function() { Must(new String("0")).be[name]() })
- })
-
- it("must "+fail+" given empty primitive", function() {
- throws(function() { Must("").be[name]() })
- })
-
- it("must "+pass+" given empty object", function() {
- doesNotThrow(function() { Must(new String("")).be[name]() })
- })
- })
-
- describe("given RegExp", function() {
- it("must "+pass+" given regexp", function() {
- doesNotThrow(function() { Must(new RegExp).be[name]() })
- })
- })
-
- describe("given Date", function() {
- it("must "+pass+" given date", function() {
- doesNotThrow(function() { Must(new Date(0)).be[name]() })
- })
- })
-
- describe("given Array", function() {
- it("must "+pass+" given empty array", function() {
- doesNotThrow(function() { Must([]).be[name]() })
- })
- })
-
- describe("given Function", function() {
- it("must "+pass+" given function", function() {
- doesNotThrow(function() { Must(function() {}).be[name]() })
- })
- })
-
- describe("given Object", function() {
- it("must "+pass+" given empty object", function() {
- doesNotThrow(function() { Must({}).be[name]() })
- })
- })
-
- it("must not do anything when not called as a function", function() {
- assert.pass(function() { void Must(!truthy).be[name] })
- })
-
- require("./_assertion_error_test")(function() { Must(!truthy).be[name]() }, {
- actual: !truthy,
- message: !truthy + " must be " + name
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(truthy).not.be[name]() })
- })
- })
-}
diff --git a/must/test/must/a_test.js b/must/test/must/a_test.js
deleted file mode 100644
index eb96816..0000000
--- a/must/test/must/a_test.js
+++ /dev/null
@@ -1,33 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.a", function() {
- it("must return an instance of Must", function() {
- assert(Must(true).a instanceof Must)
- })
-
- it("must carry over the current state", function() {
- assert.pass(function() { Must([]).be.a.instanceof(Array) })
- })
-
- it("must be like Must.prototype.instanceof", function() {
- assert.pass(function() { Must([]).be.a(Array) })
- assert.fail(function() { Must({}).be.a(Array) })
- })
-
- require("./_assertion_error_test")(function() { Must("").be.a(Array) }, {
- actual: "",
- expected: Array,
- message: "\"\" must be an instance of Array"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must([]).not.be.a(Array) })
- })
-
- it("must carry over the current state", function() {
- assert.fail(function() { Must(true).not.be.a.truthy() })
- })
- })
-})
diff --git a/must/test/must/above_test.js b/must/test/must/above_test.js
deleted file mode 100644
index f942634..0000000
--- a/must/test/must/above_test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe(".prototype.above", function() {
- it("must pass if above", function() {
- assert.pass(function() { Must(69).be.above(42) })
- })
-
- it("must fail if equal", function() {
- assert.fail(function() { Must(69).be.above(69) })
- })
-
- it("must fail if below", function() {
- assert.fail(function() { Must(69).be.above(1337) })
- })
-
- require("./_assertion_error_test")(function() { Must(42).be.above(69) }, {
- actual: 42,
- expected: 69,
- message: "42 must be above 69"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(69).not.be.above(42) })
- })
- })
-})
diff --git a/must/test/must/after_test.js b/must/test/must/after_test.js
deleted file mode 100644
index 6509b60..0000000
--- a/must/test/must/after_test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.after", function() {
- it("must be an alias of Must.prototype.above", function() {
- assert.strictEqual(Must.prototype.after, Must.prototype.above)
- })
-})
diff --git a/must/test/must/an_test.js b/must/test/must/an_test.js
deleted file mode 100644
index 45a15e6..0000000
--- a/must/test/must/an_test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var O = require("oolong")
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.an", function() {
- it("must be an alias of Must.prototype.a", function() {
- var a = O.lookupGetter(Must.prototype, "a")
- var an = O.lookupGetter(Must.prototype, "an")
- assert.strictEqual(an, a)
- })
-})
diff --git a/must/test/must/array_test.js b/must/test/must/array_test.js
deleted file mode 100644
index 9ed25cb..0000000
--- a/must/test/must/array_test.js
+++ /dev/null
@@ -1,44 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.array", function() {
- it("must pass given array", function() {
- assert.pass(function() { Must([]).be.array() })
- })
-
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.array() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.array() })
- })
-
- it("must fail given boolean primitive", function() {
- assert.fail(function() { Must(true).be.array() })
- assert.fail(function() { Must(false).be.array() })
- })
-
- it("must fail given number primitive", function() {
- assert.fail(function() { Must(0).be.array() })
- })
-
- it("must fail given string primitive", function() {
- assert.fail(function() { Must("").be.array() })
- })
-
- it("must fail given object", function() {
- assert.fail(function() { Must({}).be.array() })
- })
-
- require("./_assertion_error_test")(function() { Must(42).be.array() }, {
- actual: 42,
- message: "42 must be an array"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must([]).not.be.array() })
- })
- })
-})
diff --git a/must/test/must/assert.js b/must/test/must/assert.js
deleted file mode 100644
index fb906cd..0000000
--- a/must/test/must/assert.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var O = require("oolong")
-var assert = require("assert")
-var Must = require("../..")
-
-exports = module.exports = assert.bind(null)
-
-O.assign(exports, assert)
-
-exports.pass = function(fn) { exports.doesNotThrow(fn) }
-
-exports.fail = function(fn) { exports.throws(fn, Must.AssertionError) }
diff --git a/must/test/must/assert_test.js b/must/test/must/assert_test.js
deleted file mode 100644
index c2359ef..0000000
--- a/must/test/must/assert_test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var O = require("oolong")
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.assert", function() {
- it("must not be enumerable", function() {
- assert(O.keys(Must(undefined)).indexOf("assert") == -1)
- })
-})
diff --git a/must/test/must/at_test.js b/must/test/must/at_test.js
deleted file mode 100644
index 25018ed..0000000
--- a/must/test/must/at_test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.at", function() {
- it("must return self", function() {
- var must = Must(true)
- assert.strictEqual(must.at, must)
- })
-})
diff --git a/must/test/must/be_test.js b/must/test/must/be_test.js
deleted file mode 100644
index b7306dc..0000000
--- a/must/test/must/be_test.js
+++ /dev/null
@@ -1,39 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.be", function() {
- it("must return an instance of Must", function() {
- assert(Must(true).be instanceof Must)
- })
-
- it("must carry over the current state", function() {
- assert.pass(function() { Must(true).be.true() })
- })
-
- it("must be like Must.prototype.equal", function() {
- assert.pass(function() { Must(false).be(false) })
- assert.fail(function() { Must(true).be(false) })
-
- assert.pass(function() { Must(42).be(42) })
- assert.fail(function() { Must(42).be(1337) })
-
- assert.pass(function() { var obj = {}; Must(obj).be(obj) })
- assert.fail(function() { Must({}).be({}) })
- })
-
- require("./_assertion_error_test")(function() { Must(true).be(42) }, {
- actual: true,
- expected: 42,
- message: "true must equal 42"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(true).not.be(true) })
- })
-
- it("must carry over the current state", function() {
- assert.fail(function() { Must(true).not.be.true() })
- })
- })
-})
diff --git a/must/test/must/before_test.js b/must/test/must/before_test.js
deleted file mode 100644
index b3a5f09..0000000
--- a/must/test/must/before_test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.before", function() {
- it("must be an alias of Must.prototype.below", function() {
- assert.strictEqual(Must.prototype.before, Must.prototype.below)
- })
-})
diff --git a/must/test/must/below_test.js b/must/test/must/below_test.js
deleted file mode 100644
index ac025e5..0000000
--- a/must/test/must/below_test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe(".prototype.below", function() {
- it("must pass if below", function() {
- assert.pass(function() { Must(42).be.below(69) })
- })
-
- it("must fail if equal", function() {
- assert.fail(function() { Must(69).be.below(69) })
- })
-
- it("must fail if above", function() {
- assert.fail(function() { Must(1337).be.below(69) })
- })
-
- require("./_assertion_error_test")(function() { Must(69).be.below(42) }, {
- actual: 69,
- expected: 42,
- message: "69 must be below 42"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(42).not.be.below(69) })
- })
- })
-})
diff --git a/must/test/must/between_test.js b/must/test/must/between_test.js
deleted file mode 100644
index 6529c33..0000000
--- a/must/test/must/between_test.js
+++ /dev/null
@@ -1,37 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.between", function() {
- it("must fail if below", function() {
- assert.fail(function() { Must(41).be.between(42, 69) })
- })
-
- it("must pass if on lower bound", function() {
- assert.pass(function() { Must(42).be.between(42, 69) })
- })
-
- it("must pass if between", function() {
- assert.pass(function() { Must(50).be.between(42, 69) })
- })
-
- it("must pass if on higher bound", function() {
- assert.pass(function() { Must(69).be.between(42, 69) })
- })
-
- it("must fail if above", function() {
- assert.fail(function() { Must(70).be.between(42, 69) })
- })
-
- require("./_assertion_error_test")(function() {
- Must(13).be.between(42, 69)
- }, {
- actual: 13,
- message: "13 must be between 42 and 69"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(50).not.be.between(42, 69) })
- })
- })
-})
diff --git a/must/test/must/boolean_test.js b/must/test/must/boolean_test.js
deleted file mode 100644
index 0bac4c4..0000000
--- a/must/test/must/boolean_test.js
+++ /dev/null
@@ -1,53 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.boolean", function() {
- // Allow using new Boolean:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.boolean() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.boolean() })
- })
-
- it("must pass given boolean primitive", function() {
- assert.pass(function() { Must(true).be.boolean() })
- assert.pass(function() { Must(false).be.boolean() })
- })
-
- it("must fail given boolean object", function() {
- assert.fail(function() { Must(new Boolean(true)).be.boolean() })
- assert.fail(function() { Must(new Boolean(false)).be.boolean() })
- })
-
- it("must fail given number primitive", function() {
- assert.fail(function() { Must(0).be.boolean() })
- })
-
- it("must fail given string primitive", function() {
- assert.fail(function() { Must("").be.boolean() })
- })
-
- it("must fail given array", function() {
- assert.fail(function() { Must([]).be.boolean() })
- })
-
- it("must fail given object", function() {
- assert.fail(function() { Must({}).be.boolean() })
- })
-
- require("./_assertion_error_test")(function() { Must(42).be.boolean() }, {
- actual: 42,
- message: "42 must be a boolean"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(true).not.be.boolean() })
- })
- })
-})
diff --git a/must/test/must/contain_test.js b/must/test/must/contain_test.js
deleted file mode 100644
index 266ca87..0000000
--- a/must/test/must/contain_test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.contain", function() {
- it("must be an alias of Must.prototype.include", function() {
- assert.strictEqual(Must.prototype.contain, Must.prototype.include)
- })
-})
diff --git a/must/test/must/date_test.js b/must/test/must/date_test.js
deleted file mode 100644
index 4f2af6b..0000000
--- a/must/test/must/date_test.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.date", function() {
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.date() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.date() })
- })
-
- it("must fail given boolean primitive", function() {
- assert.fail(function() { Must(true).be.date() })
- assert.fail(function() { Must(false).be.date() })
- })
-
- it("must fail given number primitive", function() {
- assert.fail(function() { Must(0).be.date() })
- })
-
- it("must fail given string primitive", function() {
- assert.fail(function() { Must("").be.date() })
- })
-
- it("must fail given array", function() {
- assert.fail(function() { Must([]).be.date() })
- })
-
- it("must fail given object", function() {
- assert.fail(function() { Must({}).be.date() })
- })
-
- it("must pass given a date", function() {
- assert.pass(function() { Must(new Date).be.date() })
- })
-
- require("./_assertion_error_test")(function() { Must(42).be.date() }, {
- actual: 42,
- message: "42 must be a date"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(new Date).not.be.date() })
- })
- })
-})
diff --git a/must/test/must/empty_test.js b/must/test/must/empty_test.js
deleted file mode 100644
index 8ed8c2b..0000000
--- a/must/test/must/empty_test.js
+++ /dev/null
@@ -1,148 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.empty", function() {
- // Allow using new Boolean:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- describe("given Boolean", function() {
- it("must fail given a boolean primitive", function() {
- assert.fail(function() { Must(true).be.empty() })
- assert.fail(function() { Must(false).be.empty() })
- })
-
- it("must pass given a boolean object", function() {
- assert.pass(function() { Must(new Boolean(true)).be.empty() })
- assert.pass(function() { Must(new Boolean(false)).be.empty() })
- })
-
- it("must fail given a non-empty object with keys", function() {
- var obj = new Boolean(false)
- obj.life = 42
- assert.fail(function() { Must(obj).be.empty() })
- })
- })
-
- describe("given Number", function() {
- it("must fail given an zero primitive", function() {
- assert.fail(function() { Must(0).be.empty() })
- })
-
- it("must fail given a non-zero primitive", function() {
- assert.fail(function() { Must(1).be.empty() })
- })
-
- it("must pass given a zero object", function() {
- assert.pass(function() { Must(new Number).be.empty() })
- })
-
- it("must pass given a non-zero object", function() {
- assert.pass(function() { Must(new Number(1)).be.empty() })
- })
-
- it("must fail given a non-empty object with keys", function() {
- var obj = new Number(1)
- obj.life = 42
- assert.fail(function() { Must(obj).be.empty() })
- })
- })
-
- describe("given String", function() {
- it("must pass given an empty primitive", function() {
- assert.pass(function() { Must("").be.empty() })
- })
-
- it("must fail given a non-empty primitive", function() {
- assert.fail(function() { Must("a").be.empty() })
- })
-
- it("must pass given an empty object", function() {
- assert.pass(function() { Must(new String).be.empty() })
- })
-
- it("must fail given a non-empty object", function() {
- assert.fail(function() { Must(new String("a")).be.empty() })
- })
- })
-
- describe("given RegExp", function() {
- it("must pass given an empty object", function() {
- assert.pass(function() { Must(new RegExp).be.empty() })
- })
-
- it("must pass given a non-empty object", function() {
- assert.pass(function() { Must(new RegExp("a")).be.empty() })
- })
-
- it("must fail given a non-empty object with keys", function() {
- var obj = new RegExp("a")
- obj.life = 42
- assert.fail(function() { Must(obj).be.empty() })
- })
- })
-
- describe("given Array", function() {
- it("must pass given an empty primitive", function() {
- assert.pass(function() { Must([]).be.empty() })
- })
-
- it("must fail given a non-empty primitive", function() {
- assert.fail(function() { Must([1]).be.empty() })
- })
- })
-
- describe("given Function", function() {
- it("should pass given an empty object", function() {
- assert.pass(function() { Must(function() {}).be.empty() })
- })
-
- it("should pass given a non-empty object", function() {
- assert.pass(function() { Must(function() { assert() }).be.empty() })
- })
-
- it("should fail given a non-empty object with keys", function() {
- function fn() {}
- fn.life = 42
- assert.fail(function() { Must(fn).be.empty() })
- })
- })
-
- describe("given Object", function() {
- it("must pass given an empty object", function() {
- assert.pass(function() { Must({}).be.empty() })
- })
-
- it("must fail given a non-empty object", function() {
- assert.fail(function() { Must({life: 42}).be.empty() })
- })
-
- it("must fail given a non-empty inherited object", function() {
- assert.fail(function() { Must(Object.create({life: 42})).be.empty() })
- })
- })
-
- describe("given instance", function() {
- function Foo() {}
- function Bar() { this.life = 42 }
-
- it("must pass given an empty instance", function() {
- assert.pass(function() { Must(new Foo()).be.empty() })
- })
-
- it("must fail given a non-empty instance", function() {
- assert.fail(function() { Must(new Bar()).be.empty() })
- })
- })
-
- require("./_assertion_error_test")(function() { Must([1]).be.empty() }, {
- actual: [1],
- message: "[1] must be empty"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must([]).not.be.empty() })
- })
- })
-})
diff --git a/must/test/must/end_with_test.js b/must/test/must/end_with_test.js
deleted file mode 100644
index 6922f06..0000000
--- a/must/test/must/end_with_test.js
+++ /dev/null
@@ -1,42 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.endWith", function() {
- describe("given string", function() {
- it("must pass if string ends with given shorter string", function() {
- assert.pass(function() { Must("Hello, John").endWith("John") })
- })
-
- it("must fail if string does not end with given shorter string",
- function() {
- assert.fail(function() { Must("Hello, John").endWith("Mike") })
- })
-
- it("must fail if string starts with given shorter string", function() {
- assert.fail(function() { Must("Hello, John").endWith("Hello") })
- })
-
- it("must fail if string contains given string", function() {
- assert.fail(function() { Must("Hello").endWith("l") })
- })
-
- it("must fail given a longer string", function() {
- assert.fail(function() { Must("Hello").endWith("John, Hello") })
- assert.fail(function() { Must("Hello").endWith("Hello, John") })
- })
- })
-
- require("./_assertion_error_test")(function() {
- Must("Hello").endWith("Bye")
- }, {
- actual: "Hello",
- expected: "Bye",
- message: "\"Hello\" must end with \"Bye\""
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must("Hello").not.endWith("lo") })
- })
- })
-})
diff --git a/must/test/must/enumerable_property_test.js b/must/test/must/enumerable_property_test.js
deleted file mode 100644
index f168c33..0000000
--- a/must/test/must/enumerable_property_test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.enumerableProperty", function() {
- it("must be an alias of Must.prototype.enumerable", function() {
- var enumerable = Must.prototype.enumerable
- assert.strictEqual(Must.prototype.enumerableProperty, enumerable)
- })
-})
diff --git a/must/test/must/enumerable_test.js b/must/test/must/enumerable_test.js
deleted file mode 100644
index 532aec5..0000000
--- a/must/test/must/enumerable_test.js
+++ /dev/null
@@ -1,3 +0,0 @@
-describe(".prototype.enumerable", function() {
- require("./_enumerable_test")("enumerable", true)
-})
diff --git a/must/test/must/eql_test.js b/must/test/must/eql_test.js
deleted file mode 100644
index dbff2ac..0000000
--- a/must/test/must/eql_test.js
+++ /dev/null
@@ -1,767 +0,0 @@
-var _ = require("lodash")
-var O = require("oolong")
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.eql", function() {
- // Allow using new Boolean, String, Number:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
- function eql(a, b) { Must(a).be.eql(b) }
-
- testNull(eql)
- testBoolean(eql)
- testNumber(eql)
- testString(eql)
- testSymbol(eql)
- testRegExp(eql)
- testDate(eql)
- testFunction(eql)
-
- it("must fail given an empty array and empty object", function() {
- // Can't think of an assertion library that would be nuts enough to consider
- // {} equivalent to []. Oh yeah, I can! For fucks sake, this is reason #42
- // why Must.js is better!
- assert.fail(function() { Must({}).be.eql([]) })
- assert.fail(function() { Must([]).be.eql({}) })
- })
-
- describe("given Array", function() {
- it("must pass given equivalent empty arrays", function() {
- assert.pass(function() { Must([]).be.eql([]) })
- })
-
- it("must pass given empty array and Array.prototype", function() {
- assert.pass(function() { Must([]).be.eql(Array.prototype) })
- })
-
- it("must pass given equivalent arrays", function() {
- assert.pass(function() { Must([1]).be.eql([1]) })
- })
-
- it("must pass given identical arrays", function() {
- var array = []
- assert.pass(function() { Must(array).be.eql(array) })
- })
-
- it("must fail given an empty and non-empty array", function() {
- assert.fail(function() { Must([]).be.eql([1]) })
- assert.fail(function() { Must([1]).be.eql([]) })
- })
-
- it("must fail given a smaller and a larger array", function() {
- assert.fail(function() { Must([1]).be.eql([1, 2]) })
- assert.fail(function() { Must([1, 2]).be.eql([1]) })
- })
-
- it("must pass given equivalent nested arrays", function() {
- assert.pass(function() { Must([1, [2], 3]).be.eql([1, [2], 3]) })
- })
-
- it("must fail given unequivalent nested arrays", function() {
- assert.fail(function() { Must([1, [2], 3]).be.eql([1, [42], 3]) })
- })
-
- describe("with circular references", function() {
- it("must pass if equivalent", function() {
- var a = [1, 2, 3]
- a.push(a)
- a.push(5)
- var b = [1, 2, 3]
- b.push(b)
- b.push(5)
-
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must fail if only one circular", function() {
- var a = [1, 2, 3]
- a.push(a)
- a.push(5)
- var b = [1, 2, 3, [1, 2, 3, 5], 5]
- assert.fail(function() { Must(a).be.eql(b) })
- assert.fail(function() { Must(b).be.eql(a) })
- })
-
- it("must fail if circular to different levels", function() {
- var a = [1, 2, 3]
- a.push(a)
-
- var b = [1, 2, 3]
- var bInside = [1, 2, 3]
- bInside.push(bInside)
- b.push(bInside)
-
- assert.fail(function() { Must(a).be.eql(b) })
- assert.fail(function() { Must(b).be.eql(a) })
- })
- })
-
- describe("with nested values", function() {
- function nestedEql(a, b) { Must([a]).be.eql([b]) }
-
- testNull(nestedEql)
- testBoolean(nestedEql)
- testNumber(nestedEql)
- testString(nestedEql)
- testSymbol(nestedEql)
- testRegExp(nestedEql)
- testDate(nestedEql)
- testFunction(nestedEql)
- })
- })
-
- describe("given Object", function() {
- testObjectProperties(eql, _.identity)
-
- it("must pass given empty inherited objects", function() {
- var a = Object.create({})
- var b = Object.create({})
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must pass given empty ancestored objects", function() {
- var a = Object.create(Object.create({}))
- var b = Object.create(Object.create({}))
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must pass given empty objects inherited from null", function() {
- var a = Object.create(null)
- var b = Object.create(null)
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must pass given empty objects ancestored from null", function() {
- var a = Object.create(Object.create(null))
- var b = Object.create(Object.create(null))
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must pass given equivalent inherited objects", function() {
- var a = Object.create({love: 42})
- var b = Object.create({love: 42})
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must pass given equivalent ancestored objects", function() {
- var a = Object.create(Object.create({love: 42}))
- var b = Object.create(Object.create({love: 42}))
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must pass given equivalent objects inherited from null", function() {
- var a = Object.create(null, {life: {value: 42, enumerable: true}})
- var b = Object.create(null, {life: {value: 42, enumerable: true}})
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must pass given equivalent objects ancestored from null", function() {
- var a = Object.create(Object.create(null, {
- life: {value: 42, enumerable: true}
- }))
- var b = Object.create(Object.create(null, {
- life: {value: 42, enumerable: true}
- }))
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must fail given unequivalent inherited objects", function() {
- var a = Object.create({love: 42})
- var b = Object.create({love: 69})
- assert.fail(function() { Must(a).be.eql(b) })
- })
-
- it("must fail given unequivalent ancestored objects", function() {
- var a = Object.create(Object.create({love: 42}))
- var b = Object.create(Object.create({love: 69}))
- assert.fail(function() { Must(a).be.eql(b) })
- })
-
- it("must fail given unequivalent objects inherited from null",
- function() {
- var a = Object.create(null, {life: {value: 42, enumerable: true}})
- var b = Object.create(null, {life: {value: 69, enumerable: true}})
- assert.fail(function() { Must(a).be.eql(b) })
- })
-
- it("must fail given unequivalent objects ancestored from null",
- function() {
- var a = Object.create(Object.create(null, {
- life: {value: 42, enumerable: true}
- }))
-
- var b = Object.create(Object.create(null, {
- life: {value: 69, enumerable: true}
- }))
-
- assert.fail(function() { Must(a).be.eql(b) })
- })
- })
-
- describe("given Object with constructor", function() {
- function Attributes(attrs) { O.assign(this, attrs) }
- testObjectProperties(eql, function(attrs) { return new Attributes(attrs) })
-
- it("must pass given equivalent objects", function() {
- function Value(value) { this.value = value }
- var a = new Value(42); a.name = "Something"
- var b = new Value(42); b.name = "Something"
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must pass given non-function valueOfs", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = 42
- var a = new Value(42)
- var b = new Value(42)
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must pass given one with unenumerable valueOf", function() {
- function Value(value) { this.value = value }
- var a = new Value(42)
-
- var b = new Value(42)
- Object.defineProperty(b, "valueOf", {
- value: function() { return this.value }, configurable: 1, writable: 1
- })
-
- assert.pass(function() { Must(a).be.eql(b) })
- })
-
- it("must fail given unequivalent objects", function() {
- function Value(value) { this.value = value }
- var a = new Value(42); a.name = "Something"
- var b = new Value(42); b.name = "Other"
- assert.fail(function() { Must(a).be.eql(b) })
- })
-
- it("must fail given different constructors", function() {
- function A() {}
- function B() {}
- assert.fail(function() { Must(new A).eql(new B) })
- })
-
- it("must fail given instance and plain object", function() {
- function Model() {}
- var a = new Model, b = {}
- assert.fail(function() { Must(a).eql(b) })
- assert.fail(function() { Must(b).eql(a) })
- })
-
- it("must fail given subclassed constructor", function() {
- function Value(value) { this.value = value }
-
- function MoreValue(value) { this.value = value }
- MoreValue.prototype = Object.create(Value.prototype, {
- constructor: {value: MoreValue, configurable: true, writable: true}
- })
-
- var a = new Value(42)
- var b = new MoreValue(42)
- assert.fail(function() { Must(a).be.eql(b) })
- })
- })
-
- describe("given Object with valueOf", function() {
- it("must pass given equal value", function() {
- function Valuable(value) { this.value = value }
- Valuable.prototype.valueOf = function() { return this.value }
- var a = new Valuable(42), b = new Valuable(42)
- assert.pass(function() { Must(a).eql(b) })
- })
-
- it("must pass given equal value with unequivalent properties", function() {
- function Valuable(value, other) {
- this.value = value
- this.other = other
- }
-
- Valuable.prototype.valueOf = function() { return this.value }
-
- var a = new Valuable(42, 1), b = new Valuable(42, 2)
- assert.pass(function() { Must(a).eql(b) })
- })
-
- it("must pass given equal value but different valueOfs", function() {
- function Valuable(value) { this.valueOf = function() { return value } }
- var a = new Valuable(42), b = new Valuable(42)
- assert.pass(function() { Must(a).eql(b) })
- })
-
- it("must fail given unequivalent values", function() {
- function Valuable(value) { this.value = value }
- Valuable.prototype.valueOf = function() { return this.value }
- var a = new Valuable(42), b = new Valuable(69)
- assert.fail(function() { Must(a).eql(b) })
- })
-
- it("must fail given differently typed values", function() {
- function Valuable(value) { this.value = value }
- Valuable.prototype.valueOf = function() { return this.value }
- var a = new Valuable(42), b = new Valuable("42")
- assert.fail(function() { Must(a).eql(b) })
- })
-
- it("must pass given equivalent array values", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return [42, this.value] }
- var a = new Value(42)
- var b = new Value(42)
- assert.pass(function() { Must(a).eql(b) })
- })
-
- it("must fail given unequivalent array values", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return [42, this.value] }
- var a = new Value(42)
- var b = new Value(69)
- assert.fail(function() { Must(a).eql(b) })
- })
-
- it("must pass given null inherited value objects", function() {
- function Value(value) { this.value = value }
-
- Value.prototype = Object.create(null, {
- constructor: {value: Value, configurable: true, writeable: true}
- })
-
- Value.prototype.valueOf = function() { return this.value }
-
- var a = new Value(42)
- var b = new Value(42)
- assert.pass(function() { Must(a).eql(b) })
- })
-
- it("must fail given instance and plain object", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return this.value }
-
- var a = new Value(42)
- var b = {valueOf: function() { return 42 }}
- assert.fail(function() { Must(a).eql(b) })
- })
-
- it("must fail given different construtors", function() {
- function A(value) { this.value = value }
- A.prototype.valueOf = function() { return this.value }
- function B(value) { this.value = value }
- B.prototype.valueOf = function() { return this.value }
- assert.fail(function() { Must(new A(42)).eql(new B(42)) })
- })
-
- it("must fail given subclassed constructor", function() {
- function Value(value) { this.value = value }
- Value.prototype.valueOf = function() { return this.value }
-
- function MoreValue(value) { this.value = value }
- MoreValue.prototype = Object.create(Value.prototype, {
- constructor: {value: MoreValue, configurable: true, writable: true}
- })
-
- var a = new Value(42)
- var b = new MoreValue(42)
- assert.fail(function() { Must(a).eql(b) })
- })
-
- it("must fail given overwritten constructor properties", function() {
- function A(value) { this.value = value }
- A.prototype.valueOf = function() { return this.value }
- function B(value) { this.value = value }
- B.prototype.valueOf = function() { return this.value }
-
- var a = new A(42)
- var b = new B(42)
- a.constructor = b.constructor = function() {}
- assert.fail(function() { Must(a).eql(b) })
- })
-
- it("must return false given plain object", function() {
- var a = {valueOf: function() { return 1 }}
- var b = {valueOf: function() { return 1 }}
- assert.fail(function() { Must(a).eql(b) })
- })
-
- it("must return false given null inherited plain objects", function() {
- var a = Object.create(null); a.valueOf = function() { return 42 }
- var b = Object.create(null); b.valueOf = function() { return 42 }
- assert.fail(function() { Must(a).eql(b) })
- })
- })
-
- require("./_assertion_error_test")(function() { Must("secret").eql(42) }, {
- actual: "secret",
- expected: 42,
- diffable: true,
- message: "\"secret\" must be equivalent to 42"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must("secret").not.eql("secret") })
- })
- })
-})
-
-function testNull(egal) {
- it("must pass given nulls", function() {
- assert.pass(function() { egal(null, null) })
- })
-
- it("must pass given undefineds", function() {
- assert.pass(function() { egal(undefined, undefined) })
- })
-
- it("must fail given null and undefined", function() {
- assert.fail(function() { egal(null, undefined) })
- assert.fail(function() { egal(undefined, null) })
- })
-}
-
-function testBoolean(egal) {
- describe("given Boolean", function() {
- it("must pass given identical primitives", function() {
- assert.pass(function() { egal(true, true) })
- assert.pass(function() { egal(false, false) })
- })
-
- it("must fail given unidentical primitives", function() {
- assert.fail(function() { egal(true, false) })
- assert.fail(function() { egal(false, true) })
- })
-
- it("must pass given equivalent objects", function() {
- assert.pass(function() { egal(new Boolean(true), new Boolean(true)) })
- assert.pass(function() { egal(new Boolean(false), new Boolean(false)) })
- })
-
- it("must fail given unequivalent objects", function() {
- assert.fail(function() { egal(new Boolean(true), new Boolean(false)) })
- assert.fail(function() { egal(new Boolean(false), new Boolean(true)) })
- })
-
- it("must fail given equivalent primitive and object", function() {
- assert.fail(function() { egal(true, new Boolean(true)) })
- assert.fail(function() { egal(new Boolean(true), true) })
- assert.fail(function() { egal(false, new Boolean(false)) })
- assert.fail(function() { egal(new Boolean(false), false) })
- })
- })
-}
-
-function testNumber(egal) {
- describe("given Number", function() {
- it("must pass given identical primitives", function() {
- assert.pass(function() { egal(42, 42) })
- })
-
- it("must fail given unequivalent primitives", function() {
- assert.fail(function() { egal(42, 1337) })
- })
-
- it("must pass given equivalent objects", function() {
- assert.pass(function() { egal(new Number(42), new Number(42)) })
- })
-
- it("must fail given unequivalent objects", function() {
- assert.fail(function() { egal(new Number(42), new Number(69)) })
- })
-
- it("must fail given equivalent primitive and object", function() {
- assert.fail(function() { egal(42, new Number(42)) })
- assert.fail(function() { egal(new Number(42), 42) })
- })
-
- it("must fail given string primitive", function() {
- assert.fail(function() { egal(42, "42") })
- })
-
- it("must fail given string object", function() {
- assert.fail(function() { egal(42, new String("42")) })
- })
-
- describe("given -0", function() {
- it("must pass given primitives", function() {
- assert.pass(function() { egal(-0, +0) })
- assert.pass(function() { egal(+0, -0) })
- })
-
- it("must pass given objects", function() {
- assert.pass(function() { egal(new Number(-0), new Number(+0)) })
- assert.pass(function() { egal(new Number(+0), new Number(-0)) })
- })
-
- it("must fail given primitive and object", function() {
- assert.fail(function() { egal(-0, new Number(+0)) })
- assert.fail(function() { egal(new Number(-0), +0) })
- })
- })
-
- describe("given NaN", function() {
- it("must pass given primitives", function() {
- assert.pass(function() { egal(NaN, NaN) })
- })
-
- it("must pass given objects", function() {
- assert.pass(function() { egal(new Number(NaN), new Number(NaN)) })
- })
-
- it("must fail given primitive and object", function() {
- assert.fail(function() { egal(NaN, new Number(NaN)) })
- assert.fail(function() { egal(new Number(NaN), NaN) })
- })
-
- it("must fail given number and NaN", function() {
- assert.fail(function() { egal(42, NaN) })
- assert.fail(function() { egal(NaN, 42) })
- })
- })
-
- describe("given Infinity", function() {
- it("must pass given identical primitives", function() {
- assert.pass(function() { egal(Infinity, Infinity) })
- assert.pass(function() { egal(-Infinity, -Infinity) })
- })
-
- it("must fail given unequivalent primitives", function() {
- assert.fail(function() { egal(Infinity, -Infinity) })
- assert.fail(function() { egal(-Infinity, Infinity) })
- })
-
- it("must pass given equivalent objects", function() {
- assert.pass(function() {
- egal(new Number(Infinity), new Number(Infinity))
- })
-
- assert.pass(function() {
- egal(new Number(-Infinity), new Number(-Infinity))
- })
- })
-
- it("must fail given unequivalent objects", function() {
- assert.fail(function() {
- egal(new Number(Infinity), new Number(-Infinity))
- })
- assert.fail(function() {
- egal(new Number(-Infinity), new Number(Infinity))
- })
- })
-
- it("must fail given equivalent primitive and object", function() {
- assert.fail(function() { egal(Infinity, new Number(Infinity)) })
- assert.fail(function() { egal(new Number(Infinity), Infinity) })
- assert.fail(function() { egal(-Infinity, new Number(-Infinity)) })
- assert.fail(function() { egal(new Number(-Infinity), -Infinity) })
- })
-
- it("must fail given number and infinity", function() {
- assert.fail(function() { egal(42, Infinity) })
- assert.fail(function() { egal(42, -Infinity) })
- })
- })
- })
-}
-
-function testString(egal) {
- describe("given String", function() {
- it("must pass given identical primitives", function() {
- assert.pass(function() { egal("ok", "ok") })
- })
-
- it("must fail given unequivalent primitives", function() {
- assert.fail(function() { egal("ok", "nok") })
- })
-
- it("must pass given equivalent objects", function() {
- assert.pass(function() { egal(new String("a"), new String("a")) })
- })
-
- it("must fail given unequivalent objects", function() {
- assert.fail(function() { egal(new String("a"), new String("b")) })
- })
-
- it("must fail given equivalent primitive and object", function() {
- assert.fail(function() { egal("ok", new String("ok")) })
- assert.fail(function() { egal(new String("ok"), "ok") })
- })
-
- it("must fail given equivalent number primitive", function() {
- assert.fail(function() { egal("1", 1) })
- })
-
- it("must fail given equivalent number object", function() {
- assert.fail(function() { egal("1", new Number(1)) })
- })
- })
-}
-
-function testSymbol(egal) {
- var desc = typeof Symbol != "undefined" ? describe : xdescribe
-
- desc("given Symbol", function() {
- it("must pass given identical symbols", function() {
- var symbol = Symbol()
- assert.pass(function() { egal(symbol, symbol) })
- })
-
- it("must fail given two anonymous symbols", function() {
- assert.fail(function() { egal(Symbol(), Symbol()) })
- })
-
- it("must fail given two named symbols", function() {
- assert.fail(function() { egal(Symbol("iterator"), Symbol("iterator")) })
- })
- })
-}
-
-function testRegExp(egal) {
- describe("given RegExp", function() {
- it("must pass given equivalent regexps", function() {
- assert.pass(function() { egal(/a/, /a/) })
- })
-
- it("must fail given unequivalent regexps", function() {
- assert.fail(function() { egal(/a/, /b/) })
- })
-
- it("must fail given unequivalent flags", function() {
- assert.fail(function() { egal(/a/ig, /a/g) })
- })
-
- it("must fail given RegExp and string primitive", function() {
- assert.fail(function() { egal(/a/, "/a/") })
- })
- })
-}
-
-function testDate(egal) {
- describe("given Date", function() {
- it("must pass given identical dates", function() {
- var now = new Date
- assert.pass(function() { egal(now, now) })
- })
-
- it("must pass given equivalent dates", function() {
- assert.pass(function() { egal(new Date(7), new Date(7)) })
- })
-
- it("must fail given unequivalent dates", function() {
- assert.fail(function() { egal(new Date(69), new Date(42)) })
- })
-
- it("must fail given Date and number primitive", function() {
- assert.fail(function() { egal(new Date(69), 69) })
- })
- })
-}
-
-function testFunction(egal) {
- describe("given Function", function() {
- it("must pass given identical functions", function() {
- function fn() {}
- assert.pass(function() { egal(fn, fn) })
- })
-
- it("must fail given equivalent functions", function() {
- assert.fail(function() { egal(function() {}, function() {}) })
- })
- })
-}
-
-function testObjectProperties(egal, create) {
- describe("given Object with properties", function() {
- it("must pass given identical objects", function() {
- var obj = create({a: 42, b: 69})
- assert.pass(function() { egal(obj, obj) })
- })
-
- it("must pass given empty objects", function() {
- assert.pass(function() { Must(create({})).be.eql(create({})) })
- })
-
- it("must fail given an empty and filled object", function() {
- assert.fail(function() { egal({}, create({a: 42})) })
- assert.fail(function() { Must(create({a: 42})).be.eql(create({})) })
- })
-
- it("must fail given a smaller and larger object", function() {
- var a = create({a: 42, b: 69})
- var b = create({a: 42})
- assert.fail(function() { egal(a, b) })
- assert.fail(function() { egal(b, a) })
- })
-
- // This was a bug I discovered on Jun 12, 2015 related to not comparing
- // keys equivalence before comparing their values.
- it("must fail given equal amount of keys undefined keys", function() {
- var obj = {name: undefined}
- assert.fail(function() { egal(obj, {age: undefined}) })
- assert.fail(function() { egal(obj, {age: 13}) })
- })
-
- it("must pass given equivalent objects", function() {
- var a = create({a: 42, b: 69})
- var b = create({a: 42, b: 69})
- assert.pass(function() { egal(a, b) })
- })
-
- it("must fail given objects with differently typed properties", function() {
- var a = create({a: "42", b: 69})
- var b = create({a: 42, b: 69})
- assert.fail(function() { egal(a, b) })
- })
-
- it("must pass given an object with set constructor property", function() {
- var a = create({constructor: 1337})
- var b = create({constructor: 1337})
- assert.pass(function() { egal(a, b) })
- })
-
- it("must pass given a deep object", function() {
- var a = create({life: {love: 69}})
- var b = create({life: {love: 69}})
- assert.pass(function() { egal(a, b) })
- })
-
- it("must fail given an unequivalent deep object", function() {
- var a = create({life: {love: 69}})
- var b = create({life: {love: 42}})
- assert.fail(function() { egal(a, b) })
- })
-
- describe("with circular references", function() {
- it("must pass if equivalent", function() {
- var a = create({life: {love: 69}})
- a.self = a
- var b = create({life: {love: 69}})
- b.self = b
-
- assert.pass(function() { egal(a, b) })
- })
-
- it("must fail if only one circular", function() {
- var a = create({life: {love: 69}})
- a.self = a
- var b = create({life: {love: 69}})
- b.self = {life: {love: 69}, self: {}}
-
- assert.fail(function() { egal(a, b) })
- assert.fail(function() { egal(b, a) })
- })
-
- it("must fail if circular to different levels", function() {
- var a = create({life: {love: 69}})
- a.self = a
-
- var b = create({life: {love: 69}})
- var bInside = create({life: {love: 69}})
- bInside.self = bInside
- b.self = bInside
-
- assert.fail(function() { egal(a, b) })
- assert.fail(function() { egal(b, a) })
- })
- })
- })
-}
diff --git a/must/test/must/equal_test.js b/must/test/must/equal_test.js
deleted file mode 100644
index 182e3dc..0000000
--- a/must/test/must/equal_test.js
+++ /dev/null
@@ -1,152 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.equal", function() {
- // Allow using new Boolean:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- it("must pass given nulls", function() {
- assert.pass(function() { Must(null).be.equal(null) })
- })
-
- it("must pass given undefineds", function() {
- assert.pass(function() { Must(undefined).be.equal(undefined) })
- })
-
- it("must fail given null and undefined", function() {
- assert.fail(function() { Must(null).be.equal(undefined) })
- })
-
- it("must fail given undefined and null", function() {
- assert.fail(function() { Must(undefined).be.equal(null) })
- })
-
- describe("given Boolean", function() {
- function mustPassTrueEqual(bool) {
- it("must pass given "+bool+" primitives", function() {
- assert.pass(function() { Must(bool).be.equal(bool) })
- })
-
- it("must fail given "+bool+" primitive and object", function() {
- assert.fail(function() { Must(bool).be.equal(new Boolean(bool)) })
- assert.fail(function() { Must(new Boolean(bool)).be.equal(bool) })
- })
-
- it("must fail given "+bool+" primitive with "+!bool, function() {
- assert.fail(function() { Must(bool).be.equal(!bool) })
- })
- }
-
- mustPassTrueEqual(true)
- mustPassTrueEqual(false)
- })
-
- describe("given Number", function() {
- it("must pass given equivalent primitives", function() {
- assert.pass(function() { Must(42).be.equal(42) })
- })
-
- it("must fail given unequivalent primitives", function() {
- assert.fail(function() { Must(42).be.equal(1337) })
- })
-
- it("must fail given equivalent primitive and object", function() {
- assert.fail(function() { Must(42).be.equal(new Number(42)) })
- assert.fail(function() { Must(new Number(42)).be.equal(42) })
- })
-
- it("must fail given string", function() {
- assert.fail(function() { Must(42).be.equal("42") })
- })
- })
-
- describe("given String", function() {
- it("must pass given equivalent primitives", function() {
- assert.pass(function() { Must("ok").be.equal("ok") })
- })
-
- it("must fail given unequivalent primitives", function() {
- assert.fail(function() { Must("ok").be.equal("nok") })
- })
-
- it("must fail given equivalent primitive and object", function() {
- assert.fail(function() { Must("ok").be.equal(new String("ok")) })
- assert.fail(function() { Must(new String("ok")).be.equal("ok") })
- })
-
- it("must fail given number", function() {
- assert.fail(function() { Must("42").be.equal(42) })
- })
- })
-
- describe("given RegExp", function() {
- it("must fail given equivalent regexps", function() {
- assert.fail(function() { Must(/a/).be.equal(/a/) })
- })
-
- it("must fail given unequivalent regexps", function() {
- assert.fail(function() { Must(/a/).be.equal(/b/) })
- })
-
- it("must pass given identical regexps", function() {
- var regexp = new RegExp
- assert.pass(function() { Must(regexp).be.equal(regexp) })
- })
-
- it("must fail given equivalent regexps", function() {
- assert.fail(function() { Must(new RegExp).be.equal(new RegExp) })
- })
- })
-
- describe("given Date", function() {
- it("must pass given identical dates", function() {
- var now = new Date
- assert.pass(function() { Must(now).be.equal(now) })
- })
-
- it("must fail given equivalent dates", function() {
- assert.fail(function() { Must(new Date(42)).be.equal(new Date(42)) })
- })
- })
-
- describe("given Array", function() {
- it("must fail given equivalent arrays", function() {
- assert.fail(function() { Must([1]).be.equal([1]) })
- })
-
- it("must pass given identical arrays", function() {
- var array = []
- assert.pass(function() { Must(array).be.equal(array) })
- })
-
- it("must fail given unidentical arrays", function() {
- assert.fail(function() { Must([]).be.equal([]) })
- })
- })
-
- describe("given Function", function() {
- it("must pass given identical functions", function() {
- function fn() {}
- assert.pass(function() { Must(fn).be.equal(fn) })
- })
-
- it("must fail given equivalent functions", function() {
- assert.fail(function() {
- Must(function foo() {}).be.equal(function foo() {})
- })
- })
- })
-
- require("./_assertion_error_test")(function() { Must("secret").equal(42) }, {
- actual: "secret",
- expected: 42,
- message: "\"secret\" must equal 42"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must("secret").not.equal("secret") })
- })
- })
-})
diff --git a/must/test/must/error_test.js b/must/test/must/error_test.js
deleted file mode 100644
index d8c61de..0000000
--- a/must/test/must/error_test.js
+++ /dev/null
@@ -1,54 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.error", function() {
- require("./_error_test")("error", function(err) { return err })
-
- describe("given nothing", function() {
- it("must pass given error with no message", function() {
- assert.pass(function() { Must(new Error).error() })
- })
-
- it("must pass given error with message", function() {
- assert.pass(function() { Must(new Error("Problem")).error() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).error() })
- })
-
- it("must fail given null", function() {
- assert.fail(function() { Must(null).error() })
- })
-
- it("must fail given a string", function() {
- assert.fail(function() { Must("").error() })
- })
-
- it("must fail given an object", function() {
- assert.fail(function() { Must({}).error() })
- })
-
- require("./_assertion_error_test")(function() { Must(42).error() }, {
- actual: 42,
- message: "42 must be an error"
- })
- })
-
- describe("given String", function() {
- var err = new Error("Problem")
- require("./_assertion_error_test")(function() {
- Must(err).error("Oh no!")
- }, {
- actual: err,
- expected: "Oh no!",
- message: "{\"message\":\"Problem\"} must be an error matching \"Oh no!\""
- })
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(new Error).not.error() })
- })
- })
-})
diff --git a/must/test/must/eventually_test.js b/must/test/must/eventually_test.js
deleted file mode 100644
index c0cff73..0000000
--- a/must/test/must/eventually_test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var O = require("oolong")
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.eventually", function() {
- it("must be an alias of Must.prototype.resolve", function() {
- var eventually = O.lookupGetter(Must.prototype, "eventually")
- var resolve = O.lookupGetter(Must.prototype, "resolve")
- assert.strictEqual(eventually, resolve)
- })
-})
diff --git a/must/test/must/exist_test.js b/must/test/must/exist_test.js
deleted file mode 100644
index 135af80..0000000
--- a/must/test/must/exist_test.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.exist", function() {
- it("must fail if null", function() {
- assert.fail(function() { Must(null).exist() })
- })
-
- it("must fail if undefined", function() {
- assert.fail(function() { Must(undefined).exist() })
- })
-
- it("must pass if true", function() {
- assert.pass(function() { Must(true).exist() })
- })
-
- it("must pass if false", function() {
- assert.pass(function() { Must(false).exist() })
- })
-
- it("must pass if an object", function() {
- assert.pass(function() { Must({}).exist() })
- })
-
- require("./_assertion_error_test")(function() { Must(null).exist() }, {
- actual: null,
- message: "null must exist"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(true).not.exist() })
- })
- })
-})
diff --git a/must/test/must/false_test.js b/must/test/must/false_test.js
deleted file mode 100644
index 2e80d90..0000000
--- a/must/test/must/false_test.js
+++ /dev/null
@@ -1,3 +0,0 @@
-describe("Must.prototype.false", function() {
- require("./_boolean_test")("false", false)
-})
diff --git a/must/test/must/falsy_test.js b/must/test/must/falsy_test.js
deleted file mode 100644
index fb4f86c..0000000
--- a/must/test/must/falsy_test.js
+++ /dev/null
@@ -1,3 +0,0 @@
-describe("Must.prototype.falsy", function() {
- require("./_truthy_test")("falsy", false)
-})
diff --git a/must/test/must/frozen_test.js b/must/test/must/frozen_test.js
deleted file mode 100644
index fda05af..0000000
--- a/must/test/must/frozen_test.js
+++ /dev/null
@@ -1,23 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe(".prototype.frozen", function() {
- it("must pass if object is frozen", function() {
- assert.pass(function() { Must(Object.freeze({})).be.frozen() })
- })
-
- it("must fail if object is thawed", function() {
- assert.fail(function() { Must({}).be.frozen() })
- })
-
- require("./_assertion_error_test")(function() { Must({}).be.frozen() }, {
- actual: {},
- message: "{} must be frozen"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(Object.freeze({})).not.be.frozen() })
- })
- })
-})
diff --git a/must/test/must/function_test.js b/must/test/must/function_test.js
deleted file mode 100644
index 325e1bc..0000000
--- a/must/test/must/function_test.js
+++ /dev/null
@@ -1,55 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.function", function() {
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.function() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.function() })
- })
-
- it("must fail given boolean primitive", function() {
- assert.fail(function() { Must(true).be.function() })
- assert.fail(function() { Must(false).be.function() })
- })
-
- it("must fail given number primitive", function() {
- assert.fail(function() { Must(0).be.function() })
- })
-
- it("must fail given string primitive", function() {
- assert.fail(function() { Must("").be.function() })
- })
-
- it("must fail given array", function() {
- assert.fail(function() { Must([]).be.function() })
- })
-
- it("must fail given object", function() {
- assert.fail(function() { Must({}).be.function() })
- })
-
- it("must pass given function", function() {
- assert.pass(function() { Must(function() {}).be.function() })
- })
-
- it("must pass given a function with changed __proto__", function() {
- function fn() {}
- /* eslint no-proto: 0 */
- fn.__proto__ = {}
- assert.pass(function() { Must(fn).be.function() })
- })
-
- require("./_assertion_error_test")(function() { Must(42).be.function() }, {
- actual: 42,
- message: "42 must be a function"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(function() {}).not.be.function() })
- })
- })
-})
diff --git a/must/test/must/gt_test.js b/must/test/must/gt_test.js
deleted file mode 100644
index 426870f..0000000
--- a/must/test/must/gt_test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.gt", function() {
- it("must be an alias of Must.prototype.above", function() {
- assert.strictEqual(Must.prototype.gt, Must.prototype.above)
- })
-})
diff --git a/must/test/must/gte_test.js b/must/test/must/gte_test.js
deleted file mode 100644
index 515f349..0000000
--- a/must/test/must/gte_test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.gte", function() {
- it("must be an alias of Must.prototype.least", function() {
- assert.strictEqual(Must.prototype.gte, Must.prototype.least)
- })
-})
diff --git a/must/test/must/have_test.js b/must/test/must/have_test.js
deleted file mode 100644
index 253fb48..0000000
--- a/must/test/must/have_test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.have", function() {
- it("must return self", function() {
- var must = Must(true)
- assert.strictEqual(must.have, must)
- })
-})
diff --git a/must/test/must/include_test.js b/must/test/must/include_test.js
deleted file mode 100644
index adbc49b..0000000
--- a/must/test/must/include_test.js
+++ /dev/null
@@ -1,73 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.include", function() {
- // Allow using new String:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- describe("given String", function() {
- var primitive = "Hello! How are you?"
- var object = new String(primitive)
-
- it("must pass if given string primitive includes string primitive",
- function() {
- assert.pass(function() { Must(primitive).include("How") })
- })
-
- it("must fail if given string primitive does not include string primitive",
- function() {
- assert.fail(function() { Must(primitive).include("good") })
- })
-
- it("must fail if given string object includes string primitive",
- function() {
- assert.fail(function() { Must(object).include("How") })
- })
- })
-
- describe("given Array", function() {
- it("must pass if given array includes number primitive", function() {
- assert.pass(function() { Must([1, 2, 3]).include(2) })
- })
-
- it("must fail if given array does not include number primitive",
- function() {
- assert.fail(function() { Must([1, 2, 3]).include(42) })
- })
-
- it("must fail if given array includes number object", function() {
- assert.fail(function() { Must([1, 2, 3]).include(new Number(2)) })
- })
- })
-
- describe("given Object", function() {
- it("must pass if given object includes number primitive", function() {
- assert.pass(function() { Must({a: 1, b: 2, c: 3}).include(2) })
- })
-
- it("must fail if given array does not include number primitive",
- function() {
- assert.fail(function() { Must({a: 1, b: 2, c: 3}).include(42) })
- })
-
- it("must fail if given array includes number object", function() {
- var obj = ({a: 1, b: 2, c: 3})
- assert.fail(function() { Must(obj).include(new Number(2)) })
- })
- })
-
- require("./_assertion_error_test")(function() {
- Must([1, 2, 3]).include(42)
- }, {
- actual: [1, 2, 3],
- expected: 42,
- message: "[1,2,3] must include 42"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must([1, 42, 3]).not.include(42) })
- })
- })
-})
diff --git a/must/test/must/instance_of_test.js b/must/test/must/instance_of_test.js
deleted file mode 100644
index 05fcb35..0000000
--- a/must/test/must/instance_of_test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.instanceOf", function() {
- it("must be an alias of Must.prototype.instanceof", function() {
- assert.strictEqual(Must.prototype.instanceOf, Must.prototype.instanceof)
- })
-})
diff --git a/must/test/must/instanceof_test.js b/must/test/must/instanceof_test.js
deleted file mode 100644
index 24f0fc0..0000000
--- a/must/test/must/instanceof_test.js
+++ /dev/null
@@ -1,110 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.instanceof", function() {
- // Allow using new Boolean:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- describe("given Boolean", function() {
- it("must fail given boolean primitive", function() {
- assert.fail(function() { Must(true).be.instanceof(Boolean) })
- assert.fail(function() { Must(false).be.instanceof(Boolean) })
- })
-
- it("must pass given boolean object", function() {
- assert.pass(function() {
- Must(new Boolean()).be.instanceof(Boolean)
- })
- })
-
- it("must fail given Boolean constructor", function() {
- assert.fail(function() { Must(Boolean).be.instanceof(Boolean) })
- })
- })
-
- describe("given Number", function() {
- it("must fail given number primitive", function() {
- assert.fail(function() { Must(42).be.instanceof(Number) })
- })
-
- it("must pass given number object", function() {
- assert.pass(function() {
- Must(new Number()).be.instanceof(Number)
- })
- })
-
- it("must fail given Number constructor", function() {
- assert.fail(function() { Must(Number).be.instanceof(Number) })
- })
- })
-
- describe("given String", function() {
- it("must fail given string primitive", function() {
- assert.fail(function() { Must("").be.instanceof(String) })
- })
-
- it("must pass given string object", function() {
- assert.pass(function() {
- Must(new String()).be.instanceof(String)
- })
- })
-
- it("must fail given String constructor", function() {
- assert.fail(function() { Must(String).be.instanceof(String) })
- })
- })
-
- describe("given Array", function() {
- it("must pass given array", function() {
- assert.pass(function() { Must([]).be.instanceof(Array) })
- })
-
- it("must fail given Array constructor", function() {
- assert.fail(function() { Must(Array).be.instanceof(Array) })
- })
- })
-
- describe("given Function", function() {
- it("must pass given function object", function() {
- assert.pass(function() {
- Must(function() {}).be.instanceof(Function)
- })
- })
-
- it("must pass given Function constructor", function() {
- assert.pass(function() { Must(Function).be.instanceof(Function) })
- })
- })
-
- describe("given instance", function() {
- function Foo() {}
- function Bar() {}
-
- it("must pass given an instance of it", function() {
- assert.pass(function() { Must(new Foo()).be.instanceof(Foo) })
- })
-
- it("must pass given an instance of it and Object", function() {
- assert.pass(function() { Must(new Foo()).be.instanceof(Object) })
- })
-
- it("must fail given an instance of another", function() {
- assert.fail(function() { Must(new Bar()).be.instanceof(Foo) })
- })
- })
-
- require("./_assertion_error_test")(function() {
- Must([]).be.instanceof(String)
- }, {
- actual: [],
- expected: String,
- message: "[] must be an instance of String"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must([]).not.be.instanceof(Array) })
- })
- })
-})
diff --git a/must/test/must/is_test.js b/must/test/must/is_test.js
deleted file mode 100644
index db696ff..0000000
--- a/must/test/must/is_test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var O = require("oolong")
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.is", function() {
- it("must be an alias of Must.prototype.be", function() {
- var be = O.lookupGetter(Must.prototype, "be")
- var is = O.lookupGetter(Must.prototype, "is")
- assert.strictEqual(is, be)
- })
-})
diff --git a/must/test/must/keys_test.js b/must/test/must/keys_test.js
deleted file mode 100644
index dfb3052..0000000
--- a/must/test/must/keys_test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.keys", function() {
- require("./_keys_test")("keys", true)
-
- require("./_assertion_error_test")(function() {
- Must({a: 1}).have.keys(["a", "b"])
- }, {
- actual: {a: 1},
- expected: ["a", "b"],
- message: "{\"a\":1} must have keys [\"a\",\"b\"]"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must({a: 1, b: 2}).not.have.keys(["a", "b"]) })
- })
- })
-})
diff --git a/must/test/must/least_test.js b/must/test/must/least_test.js
deleted file mode 100644
index 8f0e824..0000000
--- a/must/test/must/least_test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe(".prototype.least", function() {
- it("must pass if above", function() {
- assert.pass(function() { Must(69).be.at.least(42) })
- })
-
- it("must pass if equal", function() {
- assert.pass(function() { Must(69).be.at.least(69) })
- })
-
- it("must fail if below", function() {
- assert.fail(function() { Must(69).be.at.least(1337) })
- })
-
- require("./_assertion_error_test")(function() { Must(42).be.at.least(69) }, {
- actual: 42,
- expected: 69,
- message: "42 must be at least 69"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(69).not.be.at.least(42) })
- })
- })
-})
diff --git a/must/test/must/length_test.js b/must/test/must/length_test.js
deleted file mode 100644
index 0944df2..0000000
--- a/must/test/must/length_test.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.length", function() {
- describe("given String", function() {
- it("must pass if length equal", function() {
- assert.pass(function() { Must("hello").have.length(5) })
- })
-
- it("must fail if length not equal", function() {
- assert.fail(function() { Must("hello").have.length(42) })
- })
- })
-
- describe("given Array", function() {
- it("must pass if length equal", function() {
- assert.pass(function() { Must([1, 2, 3, 4]).have.length(4) })
- })
-
- it("must fail if length not equal", function() {
- assert.fail(function() { Must([1, 2, 3, 4]).have.length(42) })
- })
- })
-
- require("./_assertion_error_test")(function() {
- Must("hello").have.length(42)
- }, {
- actual: "hello",
- expected: 42,
- message: "\"hello\" must have length of 42"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must("hello").not.have.length(5) })
- })
- })
-})
diff --git a/must/test/must/lt_test.js b/must/test/must/lt_test.js
deleted file mode 100644
index 9f2fc95..0000000
--- a/must/test/must/lt_test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.lt", function() {
- it("must be an alias of Must.prototype.below", function() {
- assert.strictEqual(Must.prototype.lt, Must.prototype.below)
- })
-})
diff --git a/must/test/must/lte_test.js b/must/test/must/lte_test.js
deleted file mode 100644
index 7670377..0000000
--- a/must/test/must/lte_test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.lte", function() {
- it("must be an alias of Must.prototype.most", function() {
- assert.strictEqual(Must.prototype.lte, Must.prototype.most)
- })
-})
diff --git a/must/test/must/match_test.js b/must/test/must/match_test.js
deleted file mode 100644
index f852b86..0000000
--- a/must/test/must/match_test.js
+++ /dev/null
@@ -1,74 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.match", function() {
- // Allow using new String:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- describe("given String and RegExp", function() {
- var primitive = "Year 2014 might be like 1984."
- var object = new String(primitive)
-
- it("must pass if given string primitive matches", function() {
- assert.pass(function() { Must(primitive).match(/^Year \d+ might/) })
- })
-
- it("must fail if given string primitive does not match", function() {
- assert.fail(function() { Must(primitive).match(/^\d+ might/) })
- })
-
- it("must pass if given string object matches", function() {
- assert.pass(function() { Must(object).match(/^Year \d+ might/) })
- })
-
- it("must fail if given string object does not match",
- function() {
- assert.fail(function() { Must(object).match(/^\d+ might/) })
- })
- })
-
- describe("given String and String", function() {
- var primitive = "Year 2014 might be like 1984."
- var object = new String(primitive)
-
- it("must pass if given string primitive matches", function() {
- assert.pass(function() {Must(primitive).match("^Year \\d+ might")})
- })
-
- it("must fail if given string primitive does not match", function() {
- assert.fail(function() { Must(primitive).match("^\\d+ might") })
- })
-
- it("must pass if given string object matches", function() {
- assert.pass(function() { Must(object).match("^Year \\d+ might") })
- })
-
- it("must fail if given string object does not match",
- function() {
- assert.fail(function() { Must(object).match("^\\d+ might") })
- })
-
- require("./_assertion_error_test")(function() {
- Must("1984").match("^2014$")
- }, {
- actual: "1984",
- expected: /^2014$/,
- message: "\"1984\" must match /^2014$/"
- })
- })
-
- require("./_assertion_error_test")(function() {
- Must("1984").match(/^2014$/)
- }, {
- actual: "1984",
- expected: /^2014$/,
- message: "\"1984\" must match /^2014$/"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must("1984").not.match(/^1984$/) })
- })
- })
-})
diff --git a/must/test/must/most_test.js b/must/test/must/most_test.js
deleted file mode 100644
index 5cb8e8c..0000000
--- a/must/test/must/most_test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe(".prototype.most", function() {
- it("must pass if below", function() {
- assert.pass(function() { Must(42).be.at.most(69) })
- })
-
- it("must pass if equal", function() {
- assert.pass(function() { Must(69).be.at.most(69) })
- })
-
- it("must fail if above", function() {
- assert.fail(function() { Must(1337).be.at.most(69) })
- })
-
- require("./_assertion_error_test")(function() { Must(69).be.at.most(42) }, {
- actual: 69,
- expected: 42,
- message: "69 must be at most 42"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(42).not.be.at.most(69) })
- })
- })
-})
diff --git a/must/test/must/must_test.js b/must/test/must/must_test.js
deleted file mode 100644
index e079323..0000000
--- a/must/test/must/must_test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.must", function() {
- it("must return self", function() {
- var must = Must(true)
- assert.strictEqual(must.must, must)
- })
-})
diff --git a/must/test/must/nan_test.js b/must/test/must/nan_test.js
deleted file mode 100644
index 4d94dd3..0000000
--- a/must/test/must/nan_test.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.null", function() {
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.nan() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.nan() })
- })
-
- it("must pass given NaN", function() {
- assert.pass(function() { Must(NaN).be.nan() })
- })
-
- it("must fail given another number", function() {
- assert.fail(function() { Must(42).be.nan() })
- })
-
- it("must fail given a string of NaN", function() {
- assert.fail(function() { Must("NaN").be.nan() })
- })
-
- it("must fail given a string of a number", function() {
- assert.fail(function() { Must("42").be.nan() })
- })
-
- describe("AssertionError", function() {
- function test() { Must(42).be.nan() }
-
- it("must be thrown", function() {
- assert.throws(test, Must.AssertionError)
- })
-
- // Can't test NaNs with strictEqual, sadly.
- it("must have all properties", function() {
- try { test() }
- catch (ex) {
- assert.strictEqual(ex.actual, 42)
- assert(isNaN(ex.expected))
- assert.strictEqual(ex.message, "42 must be NaN")
- }
- })
-
- it("must have correct stack trace", function() {
- try { test() }
- catch (ex) {
- var stack = ex.stack.split(/\r?\n/)
- assert(stack[0].match(/AssertionError/, "must include AssertionError"))
- assert(stack[1].match(/[\\\/]test[\\\/]/), "must have test at top")
- }
- })
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(NaN).not.be.nan() })
- })
- })
-})
diff --git a/must/test/must/nonenumerable_property_test.js b/must/test/must/nonenumerable_property_test.js
deleted file mode 100644
index 92aa598..0000000
--- a/must/test/must/nonenumerable_property_test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.nonenumerableProperty", function() {
- it("must be an alias of Must.prototype.nonenumerable", function() {
- var nonenumerable = Must.prototype.nonenumerable
- assert.strictEqual(Must.prototype.nonenumerableProperty, nonenumerable)
- })
-})
diff --git a/must/test/must/nonenumerable_test.js b/must/test/must/nonenumerable_test.js
deleted file mode 100644
index e31486f..0000000
--- a/must/test/must/nonenumerable_test.js
+++ /dev/null
@@ -1,3 +0,0 @@
-describe(".prototype.nonenumerable", function() {
- require("./_enumerable_test")("nonenumerable", false)
-})
diff --git a/must/test/must/not_test.js b/must/test/must/not_test.js
deleted file mode 100644
index 526eb74..0000000
--- a/must/test/must/not_test.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.not", function() {
- it("must return an instance of Must", function() {
- assert(Must(true).not instanceof Must)
- })
-
- it("must invert condition", function() {
- assert.pass(function() { Must(false).not.equal(true) })
- })
-
- it("must invert condition multiple times", function() {
- assert.pass(function() { Must(true).not.not.equal(true) })
- })
-
- it("must not modify existing instance of Must", function() {
- var must = Must(true)
- assert.fail(function() { must.not.equal(true) })
- assert.pass(function() { must.equal(true) })
- })
-
- it("must inherit from existing instance", function() {
- var must = Must(true)
- assert.strictEqual(Object.getPrototypeOf(must.not), must)
- })
-})
diff --git a/must/test/must/null_test.js b/must/test/must/null_test.js
deleted file mode 100644
index 332d9ca..0000000
--- a/must/test/must/null_test.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.null", function() {
- it("must pass given null", function() {
- assert.pass(function() { Must(null).be.null() })
- })
-
- it("must fail given true primitive", function() {
- assert.fail(function() { Must(true).be.null() })
- })
-
- it("must fail given false primitive", function() {
- assert.fail(function() { Must(false).be.null() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.null() })
- })
-
- it("must fail given empty string", function() {
- assert.fail(function() { Must("").be.null() })
- })
-
- it("must not do anything when not called as a function", function() {
- assert.pass(function() { void Must(null).be.null })
- })
-
- require("./_assertion_error_test")(function() { Must(true).be.null() }, {
- actual: true,
- expected: null,
- message: "true must be null"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(null).not.be.null() })
- })
- })
-})
diff --git a/must/test/must/number_test.js b/must/test/must/number_test.js
deleted file mode 100644
index 8c35cf9..0000000
--- a/must/test/must/number_test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.number", function() {
- // Allow using new Number:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.number() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.number() })
- })
-
- it("must fail given boolean primitive", function() {
- assert.fail(function() { Must(true).be.date() })
- assert.fail(function() { Must(false).be.date() })
- })
-
- it("must pass given number primitive", function() {
- assert.pass(function() { Must(42).be.number() })
- })
-
- it("must fail given number object", function() {
- assert.fail(function() { Must(new Number(42)).be.number() })
- })
-
- it("must fail given string primitive", function() {
- assert.fail(function() { Must("").be.number() })
- })
-
- it("must fail given array", function() {
- assert.fail(function() { Must([]).be.number() })
- })
-
- it("must fail given object", function() {
- assert.fail(function() { Must({}).be.number() })
- })
-
- require("./_assertion_error_test")(function() { Must("").be.number() }, {
- actual: "",
- message: "\"\" must be a number"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(42).not.be.number() })
- })
- })
-})
diff --git a/must/test/must/object_test.js b/must/test/must/object_test.js
deleted file mode 100644
index 418a93f..0000000
--- a/must/test/must/object_test.js
+++ /dev/null
@@ -1,44 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.object", function() {
- it("must pass given object", function() {
- assert.pass(function() { Must({}).be.object() })
- })
-
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.object() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.object() })
- })
-
- it("must fail given boolean primitive", function() {
- assert.fail(function() { Must(true).be.object() })
- assert.fail(function() { Must(false).be.object() })
- })
-
- it("must fail given number primitive", function() {
- assert.fail(function() { Must(0).be.object() })
- })
-
- it("must fail given string primitive", function() {
- assert.fail(function() { Must("").be.object() })
- })
-
- it("must pass given array", function() {
- assert.pass(function() { Must([]).be.object() })
- })
-
- require("./_assertion_error_test")(function() { Must(42).be.object() }, {
- actual: 42,
- message: "42 must be an object"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must({}).not.be.object() })
- })
- })
-})
diff --git a/must/test/must/own_keys_test.js b/must/test/must/own_keys_test.js
deleted file mode 100644
index 05423c0..0000000
--- a/must/test/must/own_keys_test.js
+++ /dev/null
@@ -1,22 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.ownKeys", function() {
- require("./_keys_test")("ownKeys", false)
-
- require("./_assertion_error_test")(function() {
- Must({a: 1}).have.ownKeys(["a", "b"])
- }, {
- actual: {a: 1},
- expected: ["a", "b"],
- message: "{\"a\":1} must have own keys [\"a\",\"b\"]"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() {
- Must({a: 1, b: 2}).not.have.ownKeys(["a", "b"])
- })
- })
- })
-})
diff --git a/must/test/must/own_properties_test.js b/must/test/must/own_properties_test.js
deleted file mode 100644
index ab4250b..0000000
--- a/must/test/must/own_properties_test.js
+++ /dev/null
@@ -1,3 +0,0 @@
-describe("Must.prototype.ownProperties", function() {
- require("./_properties_test")("ownProperties", false)
-})
diff --git a/must/test/must/own_property_test.js b/must/test/must/own_property_test.js
deleted file mode 100644
index b47aa92..0000000
--- a/must/test/must/own_property_test.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe(".prototype.ownProperty", function() {
- require("./_property_test")("ownProperty", false)
-
- it("must pass if object has property named hasOwnProperty", function() {
- assert.pass(function() {
- Must({hasOwnProperty: false}).have.ownProperty("hasOwnProperty")
- })
- })
-})
diff --git a/must/test/must/own_test.js b/must/test/must/own_test.js
deleted file mode 100644
index 86994aa..0000000
--- a/must/test/must/own_test.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.own", function() {
- it("must be an alias of Must.prototype.ownProperty", function() {
- assert.strictEqual(Must.prototype.own, Must.prototype.ownProperty)
- })
-})
diff --git a/must/test/must/permutation_of_test.js b/must/test/must/permutation_of_test.js
deleted file mode 100644
index 0dd4380..0000000
--- a/must/test/must/permutation_of_test.js
+++ /dev/null
@@ -1,49 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.permutationOf", function() {
- it("must pass if given array has same members", function() {
- assert.pass(function() { Must([1, 2, 3]).be.a.permutationOf([3, 2, 1]) })
- })
-
- it("must fail if given array does not have same members", function() {
- assert.fail(function() { Must([1, 2, 3]).be.a.permutationOf([1]) })
- })
-
- it("must fail if given array is missing duplicated members", function() {
- assert.fail(function() { Must([1, 2]).be.a.permutationOf([2, 1, 1]) })
- })
-
- it("must fail if given array has extra duplicated members", function() {
- assert.fail(function() { Must([1, 1, 2]).be.a.permutationOf([2, 1]) })
- })
-
- it("must pass if given array has same duplicated members", function() {
- assert.pass(function() { Must([1, 1, 2]).be.a.permutationOf([2, 1, 1]) })
- })
-
- it("must pass if both arrays empty", function() {
- assert.pass(function() { Must([]).be.a.permutationOf([]) })
- })
-
- it("must fail if given array has member of different type", function() {
- assert.fail(function() { Must([1]).be.a.permutationOf(["1"]) })
- })
-
- require("./_assertion_error_test")(function() {
- Must([1, 2, 3]).be.a.permutationOf([1, 2])
- }, {
- actual: [1, 2, 3],
- expected: [1, 2],
- diffable: true,
- message: "[1,2,3] must be a permutation of [1,2]"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() {
- Must([1, 2, 3]).not.be.a.permutationOf([1, 2, 3])
- })
- })
- })
-})
diff --git a/must/test/must/properties_test.js b/must/test/must/properties_test.js
deleted file mode 100644
index bef5534..0000000
--- a/must/test/must/properties_test.js
+++ /dev/null
@@ -1,3 +0,0 @@
-describe("Must.prototype.properties", function() {
- require("./_properties_test")("properties", true)
-})
diff --git a/must/test/must/property_test.js b/must/test/must/property_test.js
deleted file mode 100644
index c9863b1..0000000
--- a/must/test/must/property_test.js
+++ /dev/null
@@ -1,3 +0,0 @@
-describe("Must.prototype.property", function() {
- require("./_property_test")("property", true)
-})
diff --git a/must/test/must/regexp_test.js b/must/test/must/regexp_test.js
deleted file mode 100644
index 1999aed..0000000
--- a/must/test/must/regexp_test.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.regexp", function() {
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.regexp() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.regexp() })
- })
-
- it("must fail given boolean primitive", function() {
- assert.fail(function() { Must(true).be.regexp() })
- assert.fail(function() { Must(false).be.regexp() })
- })
-
- it("must fail given number primitive", function() {
- assert.fail(function() { Must(0).be.regexp() })
- })
-
- it("must fail given string primitive", function() {
- assert.fail(function() { Must("").be.regexp() })
- })
-
- it("must fail given array", function() {
- assert.fail(function() { Must([]).be.regexp() })
- })
-
- it("must fail given object", function() {
- assert.fail(function() { Must({}).be.regexp() })
- })
-
- it("must pass given a regexp", function() {
- assert.pass(function() { Must(/.*/).be.regexp() })
- })
-
- require("./_assertion_error_test")(function() { Must(42).be.regexp() }, {
- actual: 42,
- message: "42 must be a regular expression"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(/.*/).not.be.regexp() })
- })
- })
-})
diff --git a/must/test/must/reject_test.js b/must/test/must/reject_test.js
deleted file mode 100644
index 146a172..0000000
--- a/must/test/must/reject_test.js
+++ /dev/null
@@ -1,66 +0,0 @@
-var Promise = global.Promise || require("promise")
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.reject", function() {
- it("must return a promise from a matcher", function() {
- var promise = Must(Promise.resolve(42)).reject.number()
- assert.strictEqual(typeof promise.then, "function")
- })
-
- it("must resolve given a rejected promise with expected value", function() {
- return Must(Promise.reject(42)).reject.equal(42)
- })
-
- it("must reject given a resolved promise", function() {
- return Must(Promise.resolve(42)).reject.equal(42).then(raise, assertThrown)
- })
-
- it("must not change existing instance before resolving", function() {
- var must = Must(Promise.reject(42))
- must.reject.equal(42)
- assert.fail(function() { must.equal(42) })
- })
-
- it("must not change existing instance after resolving", function() {
- var must = Must(Promise.reject(42))
- var promise = must.reject.equal(42)
- return promise.then(function() { must.be.an.instanceof(Promise) })
- })
-
- describe("AssertionError", function() {
- function test() { return Must(Promise.reject(13)).reject.equal(42) }
-
- it("must be rejected", function() {
- return test().then(raise, assertThrown)
- })
-
- it("must have all properties", function() {
- return test().then(raise, function(err) {
- assert.deepEqual(err, {
- actual: 13,
- expected: 42,
- message: "13 must equal 42"
- })
- })
- })
-
- it("must have correct stack trace", function() {
- return test().then(raise, function(err) {
- var stack = err.stack.split(/\r?\n/)
- assert(stack[0].match(/AssertionError/, "must include AssertionError"))
- assert(stack[1].match(/[\\\/]test[\\\/]/), "must have test at top")
- })
- })
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- var promise = Must(Promise.reject(42)).reject.not.equal(42)
- return promise.then(raise, assertThrown)
- })
- })
-})
-
-function assertThrown(err) { assert(err instanceof Must.AssertionError) }
-function raise() { throw new Error("Must fail") }
diff --git a/must/test/must/resolve_test.js b/must/test/must/resolve_test.js
deleted file mode 100644
index d87fa10..0000000
--- a/must/test/must/resolve_test.js
+++ /dev/null
@@ -1,62 +0,0 @@
-var Promise = global.Promise || require("promise")
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.resolve", function() {
- it("must return a promise from a matcher", function() {
- var promise = Must(Promise.resolve(42)).resolve.number()
- assert.strictEqual(typeof promise.then, "function")
- })
-
- it("must resolve given a resolved promise with expected value", function() {
- return Must(Promise.resolve(42)).resolve.equal(42)
- })
-
- it("must not change existing instance before resolving", function() {
- var must = Must(Promise.resolve(42))
- must.resolve.equal(42)
- assert.fail(function() { must.equal(42) })
- })
-
- it("must not change existing instance after resolving", function() {
- var must = Must(Promise.resolve(42))
- var promise = must.resolve.equal(42)
- return promise.then(function() { must.be.an.instanceof(Promise) })
- })
-
- describe("AssertionError", function() {
- function test() { return Must(Promise.resolve(13)).resolve.equal(42) }
-
- it("must be rejected", function() {
- return test().then(raise, assertThrown)
- })
-
- it("must have all properties", function() {
- return test().then(raise, function(err) {
- assert.deepEqual(err, {
- actual: 13,
- expected: 42,
- message: "13 must equal 42"
- })
- })
- })
-
- it("must have correct stack trace", function() {
- return test().then(raise, function(err) {
- var stack = err.stack.split(/\r?\n/)
- assert(stack[0].match(/AssertionError/, "must include AssertionError"))
- assert(stack[1].match(/[\\/]test[\\/]/), "must have test at top")
- })
- })
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- var promise = Must(Promise.resolve(42)).resolve.not.equal(42)
- return promise.then(raise, assertThrown)
- })
- })
-})
-
-function assertThrown(err) { assert(err instanceof Must.AssertionError) }
-function raise() { throw new Error("Must fail") }
diff --git a/must/test/must/start_with_test.js b/must/test/must/start_with_test.js
deleted file mode 100644
index 7672222..0000000
--- a/must/test/must/start_with_test.js
+++ /dev/null
@@ -1,42 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.startWith", function() {
- describe("given string", function() {
- it("must pass if string starts with given shorter string", function() {
- assert.pass(function() { Must("Hello, John").startWith("Hello") })
- })
-
- it("must fail if string does not start with given shorter string",
- function() {
- assert.fail(function() { Must("Hello, John").startWith("Bye") })
- })
-
- it("must fail if string ends with given shorter string", function() {
- assert.fail(function() { Must("Hello, John").startWith("John") })
- })
-
- it("must fail if string contains given string", function() {
- assert.fail(function() { Must("Hello").startWith("l") })
- })
-
- it("must fail given a longer string", function() {
- assert.fail(function() { Must("Hello").startWith("John, Hello") })
- assert.fail(function() { Must("Hello").startWith("Hello, John") })
- })
- })
-
- require("./_assertion_error_test")(function() {
- Must("Hello").startWith("Bye")
- }, {
- actual: "Hello",
- expected: "Bye",
- message: "\"Hello\" must start with \"Bye\""
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must("Hello").not.startWith("He") })
- })
- })
-})
diff --git a/must/test/must/string_test.js b/must/test/must/string_test.js
deleted file mode 100644
index b7687dd..0000000
--- a/must/test/must/string_test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.string", function() {
- // Allow using new String:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.string() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.string() })
- })
-
- it("must fail given boolean primitive", function() {
- assert.fail(function() { Must(true).be.date() })
- assert.fail(function() { Must(false).be.date() })
- })
-
- it("must fail given number primitive", function() {
- assert.fail(function() { Must(0).be.string() })
- })
-
- it("must pass given string primitive", function() {
- assert.pass(function() { Must("").be.string() })
- })
-
- it("must fail given string object", function() {
- assert.fail(function() { Must(new String("")).be.string() })
- })
-
- it("must fail given array", function() {
- assert.fail(function() { Must([]).be.string() })
- })
-
- it("must fail given object", function() {
- assert.fail(function() { Must({}).be.string() })
- })
-
- require("./_assertion_error_test")(function() { Must(42).be.string() }, {
- actual: 42,
- message: "42 must be a string"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must("").not.be.string() })
- })
- })
-})
diff --git a/must/test/must/symbol_test.js b/must/test/must/symbol_test.js
deleted file mode 100644
index e82f73d..0000000
--- a/must/test/must/symbol_test.js
+++ /dev/null
@@ -1,49 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-var describeSymbol = typeof Symbol != "undefined" ? describe : xdescribe
-
-describeSymbol("Must.prototype.symbol", function() {
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.symbol() })
- })
-
- it("must fail given undefined", function() {
- assert.fail(function() { Must(undefined).be.symbol() })
- })
-
- it("must fail given boolean primitive", function() {
- assert.fail(function() { Must(true).be.date() })
- assert.fail(function() { Must(false).be.date() })
- })
-
- it("must pass given symbol", function() {
- assert.pass(function() { Must(Symbol()).be.symbol() })
- })
-
- it("must fail given number primitive", function() {
- assert.fail(function() { Must(42).be.symbol() })
- })
-
- it("must fail given string primitive", function() {
- assert.fail(function() { Must("").be.symbol() })
- })
-
- it("must fail given array", function() {
- assert.fail(function() { Must([]).be.symbol() })
- })
-
- it("must fail given object", function() {
- assert.fail(function() { Must({}).be.symbol() })
- })
-
- require("./_assertion_error_test")(function() { Must("").be.symbol() }, {
- actual: "",
- message: "\"\" must be a symbol"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(Symbol()).not.be.symbol() })
- })
- })
-})
diff --git a/must/test/must/the_test.js b/must/test/must/the_test.js
deleted file mode 100644
index 0821981..0000000
--- a/must/test/must/the_test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.the", function() {
- it("must return self", function() {
- var must = Must(true)
- assert.strictEqual(must.the, must)
- })
-})
diff --git a/must/test/must/then_test.js b/must/test/must/then_test.js
deleted file mode 100644
index 556ad55..0000000
--- a/must/test/must/then_test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var O = require("oolong")
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.then", function() {
- it("must be an alias of Must.prototype.resolve", function() {
- var then = O.lookupGetter(Must.prototype, "then")
- var resolve = O.lookupGetter(Must.prototype, "resolve")
- assert.strictEqual(then, resolve)
- })
-})
diff --git a/must/test/must/throw_test.js b/must/test/must/throw_test.js
deleted file mode 100644
index 823fc9a..0000000
--- a/must/test/must/throw_test.js
+++ /dev/null
@@ -1,137 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.throw", function() {
- /* eslint no-throw-literal: 0 */
-
- require("./_error_test")("throw", function(err) {
- return function() { throw err }
- })
-
- it("must invoke function in no context", function() {
- "use strict"
- var context
- Must(function() { context = this }).not.throw()
- assert.strictEqual(context, null)
- })
-
- describe("given nothing", function() {
- it("must pass if function throws", function() {
- assert.pass(function() { Must(function() { throw 5 }).throw() })
- })
-
- it("must pass even if function throws undefined", function() {
- assert.pass(function() { Must(function() { throw undefined }).throw() })
- })
-
- it("must fail if function does not throw", function() {
- assert.fail(function() { Must(noop).throw() })
- })
-
- function noThrower() { void 42 }
- require("./_assertion_error_test")(function() { Must(noThrower).throw() }, {
- actual: undefined,
- message: "function noThrower() { void 42 } must throw"
- })
- })
-
- describe("given null", function() {
- it("must pass if function throws null", function() {
- assert.pass(function() {
- Must(function() { throw null }).throw(null)
- })
- })
-
- it("must fail if function throws undefined", function() {
- assert.fail(function() {
- Must(function() { throw undefined }).throw(null)
- })
- })
-
- it("must fail if function does not throw", function() {
- assert.fail(function() { Must(noop).throw(null) })
- })
- })
-
- describe("given undefined", function() {
- it("must pass if function throws undefined", function() {
- assert.pass(function() {
- Must(function() { throw undefined }).throw(undefined)
- })
- })
-
- it("must fail if function throws null", function() {
- assert.fail(function() {
- Must(function() { throw null }).throw(undefined)
- })
- })
-
- it("must fail if function does not throw", function() {
- assert.fail(function() { Must(noop).throw(undefined) })
- })
- })
-
- describe("given String", function() {
- function stringThrower() { throw "Oh no!" }
-
- it("must pass if function throws an identical string", function() {
- assert.pass(function() { Must(stringThrower).throw("Oh no!") })
- })
-
- it("must fail if function throws with part of identical string",
- function() {
- assert.fail(function() { Must(stringThrower).throw("Oh no") })
- })
-
- it("must fail if function throws an equivalent number", function() {
- assert.fail(function() { Must(function() { throw 42 }).throw("42") })
- })
-
- it("must fail if function throws an unequivalent string", function() {
- assert.fail(function() { Must(stringThrower).throw("Oh yes!") })
- })
-
- it("must fail if function does not throw", function() {
- assert.fail(function() { Must(noop).throw("Oh no!") })
- })
-
- function thrower() { throw "Nope!" }
- require("./_assertion_error_test")(function() {
- Must(thrower).throw("Oh no!")
- }, {
- actual: "Nope!",
- expected: "Oh no!",
- message: "function thrower() { throw \"Nope!\" } must throw \"Oh no!\""
- })
- })
-
- describe("given RegExp", function() {
- function stringThrower() { throw "Oh no!" }
-
- it("must pass if function throws an matching string", function() {
- assert.pass(function() { Must(stringThrower).throw(/no!/) })
- })
-
- it("must fail if function throws an unmatching string", function() {
- assert.fail(function() { Must(stringThrower).throw(/yes!/) })
- })
-
- it("must fail if function does not throw", function() {
- assert.fail(function() { Must(noop).throw(/no!/) })
- })
- })
-
- describe("given Function", function() {
- it("must fail if function does not throw", function() {
- assert.fail(function() { Must(noop).throw(Error) })
- })
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(function() { throw 42 }).not.throw() })
- })
- })
-})
-
-function noop() {}
diff --git a/must/test/must/to_test.js b/must/test/must/to_test.js
deleted file mode 100644
index b88cd66..0000000
--- a/must/test/must/to_test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.to", function() {
- it("must return self", function() {
- var must = Must(true)
- assert.strictEqual(must.to, must)
- })
-})
diff --git a/must/test/must/true_test.js b/must/test/must/true_test.js
deleted file mode 100644
index 5af8b64..0000000
--- a/must/test/must/true_test.js
+++ /dev/null
@@ -1,3 +0,0 @@
-describe("Must.prototype.true", function() {
- require("./_boolean_test")("true", true)
-})
diff --git a/must/test/must/truthy_test.js b/must/test/must/truthy_test.js
deleted file mode 100644
index ecb01f8..0000000
--- a/must/test/must/truthy_test.js
+++ /dev/null
@@ -1,3 +0,0 @@
-describe("Must.prototype.truthy", function() {
- require("./_truthy_test")("truthy", true)
-})
diff --git a/must/test/must/undefined_test.js b/must/test/must/undefined_test.js
deleted file mode 100644
index 1eab1f7..0000000
--- a/must/test/must/undefined_test.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.undefined", function() {
- it("must pass given undefined", function() {
- assert.pass(function() { Must(undefined).be.undefined() })
- })
-
- it("must fail given true primitive", function() {
- assert.fail(function() { Must(true).be.undefined() })
- })
-
- it("must fail given false primitive", function() {
- assert.fail(function() { Must(false).be.undefined() })
- })
-
- it("must fail given null", function() {
- assert.fail(function() { Must(null).be.undefined() })
- })
-
- it("must fail given empty string", function() {
- assert.fail(function() { Must("").be.undefined() })
- })
-
- it("must not do anything when not called as a function", function() {
- assert.pass(function() { void Must(undefined).be.undefined })
- })
-
- require("./_assertion_error_test")(function() { Must(true).be.undefined() }, {
- actual: true,
- expected: undefined,
- message: "true must be undefined"
- })
-
- describe(".not", function() {
- it("must invert the assertion", function() {
- assert.fail(function() { Must(undefined).not.be.undefined() })
- })
- })
-})
diff --git a/must/test/must/with_test.js b/must/test/must/with_test.js
deleted file mode 100644
index f7798df..0000000
--- a/must/test/must/with_test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var Must = require("../..")
-var assert = require("./assert")
-
-describe("Must.prototype.with", function() {
- it("must return self", function() {
- var must = Must(true)
- assert.strictEqual(must.with, must)
- })
-})
diff --git a/must/test/must_test.js b/must/test/must_test.js
deleted file mode 100644
index 4269c75..0000000
--- a/must/test/must_test.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Bootstrapping with Assert ^_^:
-var Must = require("..")
-var assert = require("assert")
-
-describe("Must", function() {
- it("must return an instance of itself when called as a function", function() {
- assert(Must() instanceof Must)
- })
-
- it("must have a constructor property", function() {
- assert.strictEqual(new Must().constructor, Must)
- })
-
- it("must have constructor as a non-enumerable property", function() {
- var must = new Must
- for (var key in must) assert.notEqual(key, "constructor")
- })
-
- it("must have name", function() {
- assert.strictEqual(Must.name, "Must")
- })
-
- describe("new", function() {
- it("must return an instance of Must", function() {
- assert(new Must instanceof Must)
- })
-
- describe("given message", function() {
- require("./must/_assertion_error_test")(function() {
- Must(false, "Negativity").true()
- }, {
- actual: false,
- expected: true,
- message: "Negativity: false must be true"
- })
- })
- })
-})
diff --git a/must/test/register_test.js b/must/test/register_test.js
deleted file mode 100644
index 021f29a..0000000
--- a/must/test/register_test.js
+++ /dev/null
@@ -1,121 +0,0 @@
-var Path = require("path")
-var Must
-var assert = require("assert")
-
-function reload() {
- // Reload to reset the fiddling we did here.
- delete require.cache[Path.resolve(__dirname, "../register.js")]
- Must = require("../register")
-}
-
-describe("Object.prototype.must", function() {
- beforeEach(reload)
- afterEach(function() { delete Object.prototype.must })
-
- it("must exist", function() {
- assert(true.must)
- })
-
- it("must return an instance of Must", function() {
- assert(true.must instanceof Must)
- })
-
- it("must be deletable", function() {
- delete Object.prototype.must
- assert(!true.must)
- })
-
- it("must be non-enumerable", function() {
- for (var key in this) assert.notEqual(key, "must")
- })
-
- it("must be writable", function() {
- var obj = {}
- obj.must = 42
- assert.strictEqual(obj.must, 42)
- })
-
- describe("when called on", function() {
- // Allow using Boolean, Number, String as constructor in tests:
- /* jshint -W053 */
- /* eslint no-new-wrappers: 0 */
-
- it("must not box boolean", function() {
- assert.strictEqual(true.must.actual, true)
- })
-
- it("must not box number", function() {
- assert.strictEqual((42).must.actual, 42)
- })
-
- it("must not box string", function() {
- assert.strictEqual("foo".must.actual, "foo")
- })
-
- it("must leave boxed boolean as-is", function() {
- var boolean = new Boolean(true)
- assert.strictEqual(boolean.must.actual, boolean)
- })
-
- it("must leave boxed number as-is", function() {
- var number = new Number(42)
- assert.strictEqual(number.must.actual, number)
- })
-
- it("must leave boxed string as-is", function() {
- var string = new String("hello")
- assert.strictEqual(string.must.actual, string)
- })
-
- it("must not unbox date", function() {
- var date = new Date
- date.valueOf = function() {}
- assert.strictEqual(date.must.actual, date)
- })
-
- it("must not unbox RegExp", function() {
- var regexp = new RegExp
- regexp.valueOf = function() {}
- assert.strictEqual(regexp.must.actual, regexp)
- })
-
- it("must not unbox array", function() {
- var array = []
- array.valueOf = function() {}
- assert.strictEqual(array.must.actual, array)
- })
-
- it("must not unbox object", function() {
- var object = {}
- object.valueOf = function() {}
- assert.strictEqual(object.must.actual, object)
- })
-
- it("must not unbox custom instance", function() {
- function Foo() {}
- Foo.prototype.valueOf = function() {}
- var foo = new Foo
- assert.strictEqual(foo.must.actual, foo)
- })
- })
-})
-
-describe("Global.must", function() {
- /* global must */
- beforeEach(reload)
- afterEach(function() { delete global.must })
-
- it("must be an instance of Must by default", function() {
- assert(must instanceof Must)
- })
-
- it("must be writable", function() {
- global.must = 42
- assert.strictEqual(must, 42)
- })
-
- it("must be writable to Must", function() {
- global.must = Must
- assert.strictEqual(must, Must)
- })
-})
diff --git a/oolong/.npmignore b/oolong/.npmignore
deleted file mode 100644
index 10e8d4c..0000000
--- a/oolong/.npmignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/*.tgz
-/tmp/
-/.travis.yml
diff --git a/oolong/CHANGELOG.md b/oolong/CHANGELOG.md
deleted file mode 100644
index fe52176..0000000
--- a/oolong/CHANGELOG.md
+++ /dev/null
@@ -1,124 +0,0 @@
-## 1.15.1 (Jul 21, 2016)
-- Fixes [`Oolong.create`][create] to not mutate the prototype argument under global strict mode when given objects to assign to it.
- This affected only people running their JavaScript engine (like V8) under global strict mode (`--use-strict`), which seems very rare.
-
-## 1.15.0 (Jul 15, 2016)
-- Adds [`Oolong.assignOwn`][assignOwn].
-
-[assignOwn]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.assignOwn
-
-## 1.14.1 (Nov 12, 2015)
-- Changes [`Oolong.pickDeep`][pickDeep] to take an array of keys (`["a", "b",
- "c"]`) instead of a string with embedded periods (`a.b.c`).
- As using periods initially was a brain fluke noticed shortly after releasing
- v1.14, increasing only the patch version number.
-
-## 1.14.0 (Nov 12, 2015)
-- Adds [`Oolong.pick`][pick].
-- Adds [`Oolong.pickDeep`][pickDeep].
-
-[pick]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.pick
-[pickDeep]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.pickDeep
-
-## 1.13.0 (Jul 24, 2015)
-- Adds [`Oolong.property`][property].
-- Adds [`Oolong.object`][object].
-- Adds [`Oolong.pluck`][pluck].
-
-[property]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.property
-[object]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.object
-[pluck]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.pluck
-
-## 1.12.0 (Jun 26, 2015)
-- Adds [`Oolong.setPrototypeOf`][setPrototypeOf].
-
-[setPrototypeOf]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.setPrototypeOf
-
-## 1.11.1 (Jun 24, 2015)
-- Fixes [`Oolong.isPlainObject`][isPlainObject] to return `false` for
- `Array.prototype`.
- JavaScript is a prototypical language after all and the prototype of an array
- is an array.
-
-## 1.11.0 (Jun 14, 2015)
-- Adds [`Oolong.lookupGetter`][lookupGetter].
-- Adds [`Oolong.lookupSetter`][lookupSetter].
-
-[lookupGetter]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.lookupGetter
-[lookupSetter]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.lookupSetter
-
-## 1.10.0 (Jun 12, 2015)
-- Adds [`Oolong.isObject`][isObject].
-
-[isObject]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isObject
-
-## 1.9.0 (Jun 1, 2015)
-- Adds [`Oolong.wrap`][wrap].
-
-[wrap]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.wrap
-
-## 1.8.0 (May 29, 2015)
-- Adds [`Oolong.defineGetter`][defineGetter].
-- Adds [`Oolong.defineSetter`][defineSetter].
-
-[defineGetter]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.defineGetter
-[defineSetter]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.defineSetter
-
-## 1.7.0 (Apr 15, 2015)
-- Renames Objectware to Oolong.
-
-## 1.6.0 (Feb 19, 2015)
-- Adds [`Oolong.create`][create].
-- Adds [`Oolong.defaults`][defaults].
-
-[create]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.create
-[defaults]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.defaults
-
-## 1.5.0 (Feb 10, 2015)
-- Adds [`Oolong.each`][each].
-- Adds [`Oolong.eachOwn`][eachOwn].
-- Adds [`Oolong.forEach`][forEach].
-- Adds [`Oolong.forEachOwn`][forEachOwn].
-- Adds [`Oolong.has`][has].
-- Adds [`Oolong.hasOwn`][hasOwn].
-- Adds [`Oolong.isInOwn`][isInOwn].
-- Adds [`Oolong.isOwnEmpty`][isOwnEmpty].
-- Adds [`Oolong.ownKeys`][ownKeys].
-
-[each]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.each
-[eachOwn]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.eachOwn
-[forEach]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.forEach
-[forEachOwn]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.forEachOwn
-[has]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.has
-[hasOwn]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.hasOwn
-[isInOwn]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isInOwn
-[isOwnEmpty]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isOwnEmpty
-[ownKeys]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.ownKeys
-
-## 1.4.0 (Feb 8, 2015)
-- Adds [`Oolong.reject`][reject].
-
-[reject]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.reject
-
-## 1.3.0 (Feb 8, 2015)
-- Adds [`Oolong.isIn`][isIn].
-
-[isIn]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isIn
-
-## 1.2.0 (Feb 7, 2015)
-- Fixes [`Oolong.merge`][merge] to clone plain objects objects
- recursively.
- Previously in some cases it cloned objects shallowly.
-- Adds [`Oolong.cloneDeep`][cloneDeep].
-
-[cloneDeep]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.cloneDeep
-
-## 1.1.0 (Feb 7, 2015)
-- Adds [`Oolong.isPlainObject`][isPlainObject].
-- Adds [`Oolong.merge`][merge].
-
-[isPlainObject]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isPlainObject
-[merge]: https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.merge
-
-## 1.0.0 (Jan 13, 2015)
-- Perfectly objective.
diff --git a/oolong/LICENSE b/oolong/LICENSE
deleted file mode 100644
index 3488ac1..0000000
--- a/oolong/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Oolong.js
-Copyright (C) 2014– Andri Möll <andri@dot.ee>
-
-This program is free software: you can redistribute it and/or modify it under
-the terms of the GNU Affero General Public License as published by the Free
-Software Foundation, either version 3 of the License, or any later version.
-
-Additional permission under the GNU Affero GPL version 3 section 7:
-If you modify this Program, or any covered work, by linking or
-combining it with other code, such other code is not for that reason
-alone subject to any of the requirements of the GNU Affero GPL version 3.
-
-In summary:
-- You can use this program for no cost.
-- You can use this program for both personal and commercial reasons.
-- You do not have to share your own program's code which uses this program.
-- You have to share modifications (e.g bug-fixes) you've made to this program.
-
-For the full copy of the GNU Affero General Public License see:
-http://www.gnu.org/licenses.
diff --git a/oolong/Makefile b/oolong/Makefile
deleted file mode 100644
index d16e11d..0000000
--- a/oolong/Makefile
+++ /dev/null
@@ -1,59 +0,0 @@
-NODE = node
-NODE_OPTS = --use-strict
-TEST_OPTS =
-
-# NOTE: Sorry, mocumentation is not yet published.
-MOCUMENT = ~/Documents/Mocumentation/bin/mocument
-MOCUMENT_OPTS = --type yui --title Oolong.js
-GITHUB_URL = https://github.com/moll/js-oolong
-
-love:
- @echo "Feel like makin' love."
-
-test:
- @$(NODE) $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS)
-
-spec:
- @$(NODE) $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS)
-
-autotest:
- @$(NODE) $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS)
-
-autospec:
- @$(NODE) $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS)
-
-pack:
- @file=$$(npm pack); echo "$$file"; tar tf "$$file"
-
-publish:
- npm publish
-
-tag:
- git tag "v$$($(NODE) -e 'console.log(require("./package").version)')"
-
-doc: doc.json
- @mkdir -p doc
- @$(MOCUMENT) $(MOCUMENT_OPTS) tmp/doc/data.json > doc/API.md
-
-toc: doc.json
- @$(MOCUMENT) $(MOCUMENT_OPTS) \
- --template toc \
- --var api_url=$(GITHUB_URL)/blob/master/doc/API.md \
- tmp/doc/data.json > tmp/TOC.md
-
- @echo '/^API$$/,/^License$$/{/^API$$/{r tmp/TOC.md\na\\\n\\\n\\\n\n};/^License/!d;}' |\
- sed -i "" -f /dev/stdin README.md
-
-doc.json:
- @mkdir -p tmp
- @yuidoc --exclude test,node_modules --parse-only --outdir tmp/doc .
-
-clean:
- rm -f *.tgz tmp
- npm prune --production
-
-.PHONY: love
-.PHONY: test spec autotest autospec
-.PHONY: pack publish tag
-.PHONY: doc toc doc.json
-.PHONY: clean
diff --git a/oolong/README.md b/oolong/README.md
deleted file mode 100644
index 44f6fc8..0000000
--- a/oolong/README.md
+++ /dev/null
@@ -1,107 +0,0 @@
-Oolong.js
-=========
-[![NPM version][npm-badge]](https://www.npmjs.com/package/oolong)
-[![Build status][travis-badge]](https://travis-ci.org/moll/js-oolong)
-
-**Oolong.js** is a library for JavaScript full of **object-related
-utilities**. It's similar to [Underscore.js][underscore], but it focuses
-strictly on functions **dealing with objects**. It's implementation emphasizes
-**simplicity** and **good taste**. For example, it always **takes inherited
-properties** into account leading to less surprises for users of your code.
-
-**Oolong.js** grew out of my frustration with [Underscore.js][underscore]
-and [Lodash.js][lodash] and their inconsistent and sometimes outright ignorance
-of inherited properties. This leads to unnecessary complexity, arbitrary
-constraints and a leaky-implementation in your code or public APIs. This
-behavior is cancer propelled around by ignorance and misunderstandings between
-dictionaries and interfaces. Oolong.js is my first step at killing it.
-
-[npm-badge]: https://img.shields.io/npm/v/oolong.svg
-[travis-badge]: https://travis-ci.org/moll/js-oolong.png?branch=master
-[underscore]: https://underscorejs.org
-[lodash]: https://lodash.com
-
-
-Installing
-----------
-```sh
-npm install oolong
-```
-
-Oolong.js follows [semantic versioning](http://semver.org/), so feel free to
-depend on its major version with something like `>= 1.0.0 < 2` (a.k.a `^1.0.0`).
-
-
-API
----
-For extended documentation on all functions, please see the
-[Oolong.js API Documentation][api].
-
-[api]: https://github.com/moll/js-oolong/blob/master/doc/API.md
-
-### [Oolong](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong)
-- [.assign](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.assign)(target, source...)
-- [.assignOwn](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.assignOwn)(target, source...)
-- [.clone](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.clone)(object)
-- [.cloneDeep](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.cloneDeep)(object)
-- [.create](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.create)(prototype, [source...])
-- [.defaults](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.defaults)(target, source...)
-- [.defineGetter](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.defineGetter)(object, property, fn)
-- [.defineSetter](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.defineSetter)(object, property, fn)
-- [.each](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.each)(object, callback, [thisArg])
-- [.eachOwn](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.eachOwn)(object, callback, [thisArg])
-- [.filter](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.filter)(object, callback, [thisArg])
-- [.forEach](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.forEach)(object, callback, [thisArg])
-- [.forEachOwn](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.forEachOwn)(object, callback, [thisArg])
-- [.has](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.has)(object, key)
-- [.hasOwn](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.hasOwn)(object, key)
-- [.isEmpty](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isEmpty)(object)
-- [.isIn](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isIn)(object, key)
-- [.isInOwn](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isInOwn)(object, key)
-- [.isObject](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isObject)(object)
-- [.isOwnEmpty](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isOwnEmpty)(object)
-- [.isPlainObject](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.isPlainObject)(object)
-- [.keys](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.keys)(object)
-- [.lookupGetter](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.lookupGetter)(object, property)
-- [.lookupSetter](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.lookupSetter)(object, property)
-- [.map](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.map)(object, callback, [thisArg])
-- [.mapKeys](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.mapKeys)(object, callback, [thisArg])
-- [.merge](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.merge)(target, source...)
-- [.object](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.object)(keys, callback, [thisArg])
-- [.ownKeys](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.ownKeys)(object)
-- [.pick](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.pick)(object, keys...)
-- [.pickDeep](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.pickDeep)(object, keys...)
-- [.pluck](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.pluck)(object, key)
-- [.property](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.property)(key)
-- [.reject](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.reject)(object, callback, [thisArg])
-- [.setPrototypeOf](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.setPrototypeOf)(object, prototype)
-- [.values](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.values)(object)
-- [.wrap](https://github.com/moll/js-oolong/blob/master/doc/API.md#Oolong.wrap)(value, key)
-
-
-License
--------
-Oolong.js is released under a *Lesser GNU Affero General Public License*,
-which in summary means:
-
-- You **can** use this program for **no cost**.
-- You **can** use this program for **both personal and commercial reasons**.
-- You **do not have to share your own program's code** which uses this program.
-- You **have to share modifications** (e.g. bug-fixes) you've made to this
- program.
-
-For more convoluted language, see the `LICENSE` file.
-
-
-About
------
-**[Andri Möll][moll]** typed this and the code.
-[Monday Calendar][monday] supported the engineering work.
-
-If you find Oolong.js needs improving, please don't hesitate to type to me
-now at [andri@dot.ee][email] or [create an issue online][issues].
-
-[email]: mailto:andri@dot.ee
-[issues]: https://github.com/moll/js-oolong/issues
-[moll]: http://themoll.com
-[monday]: https://mondayapp.com
diff --git a/oolong/doc/API.md b/oolong/doc/API.md
deleted file mode 100644
index d709330..0000000
--- a/oolong/doc/API.md
+++ /dev/null
@@ -1,553 +0,0 @@
-Oolong.js API Documentation
-===========================
-### [Oolong](#Oolong)
-- [.assign](#Oolong.assign)(target, source...)
-- [.assignOwn](#Oolong.assignOwn)(target, source...)
-- [.clone](#Oolong.clone)(object)
-- [.cloneDeep](#Oolong.cloneDeep)(object)
-- [.create](#Oolong.create)(prototype, [source...])
-- [.defaults](#Oolong.defaults)(target, source...)
-- [.defineGetter](#Oolong.defineGetter)(object, property, fn)
-- [.defineSetter](#Oolong.defineSetter)(object, property, fn)
-- [.each](#Oolong.each)(object, callback, [thisArg])
-- [.eachOwn](#Oolong.eachOwn)(object, callback, [thisArg])
-- [.filter](#Oolong.filter)(object, callback, [thisArg])
-- [.forEach](#Oolong.forEach)(object, callback, [thisArg])
-- [.forEachOwn](#Oolong.forEachOwn)(object, callback, [thisArg])
-- [.has](#Oolong.has)(object, key)
-- [.hasOwn](#Oolong.hasOwn)(object, key)
-- [.isEmpty](#Oolong.isEmpty)(object)
-- [.isIn](#Oolong.isIn)(object, key)
-- [.isInOwn](#Oolong.isInOwn)(object, key)
-- [.isObject](#Oolong.isObject)(object)
-- [.isOwnEmpty](#Oolong.isOwnEmpty)(object)
-- [.isPlainObject](#Oolong.isPlainObject)(object)
-- [.keys](#Oolong.keys)(object)
-- [.lookupGetter](#Oolong.lookupGetter)(object, property)
-- [.lookupSetter](#Oolong.lookupSetter)(object, property)
-- [.map](#Oolong.map)(object, callback, [thisArg])
-- [.mapKeys](#Oolong.mapKeys)(object, callback, [thisArg])
-- [.merge](#Oolong.merge)(target, source...)
-- [.object](#Oolong.object)(keys, callback, [thisArg])
-- [.ownKeys](#Oolong.ownKeys)(object)
-- [.pick](#Oolong.pick)(object, keys...)
-- [.pickDeep](#Oolong.pickDeep)(object, keys...)
-- [.pluck](#Oolong.pluck)(object, key)
-- [.property](#Oolong.property)(key)
-- [.reject](#Oolong.reject)(object, callback, [thisArg])
-- [.setPrototypeOf](#Oolong.setPrototypeOf)(object, prototype)
-- [.values](#Oolong.values)(object)
-- [.wrap](#Oolong.wrap)(value, key)
-
-
-<a name="Oolong" />
-Oolong
-------
-
-
-<a name="Oolong.assign" />
-### Oolong.assign(target, source...)
-Assigns all enumerable properties on `source` objects to `target`.
-Similar to `Object.assign`, but takes inherited properties into account.
-Does not modify anything in the source objects.
-Returns `target`.
-
-Think of it as _extending_ the first object step by step with others.
-
-**Examples**:
-```javascript
-Oolong.assign({name: "John"}, {age: 32}, {shirt: "blue"})
-// => {name: "John", age: 32, shirt: "blue"}
-```
-
-<a name="Oolong.assignOwn" />
-### Oolong.assignOwn(target, source...)
-Assigns all own enumerable properties on `source` objects to `target`.
-Like `Object.assign`. Does not modify anything in the source objects.
-Returns `target`.
-
-Think of it as _extending_ the first object step by step with others.
-
-**Examples**:
-```javascript
-Oolong.assignOwn({name: "John"}, {age: 32}, Object.create({shirt: "blue"}))
-// => {name: "John", age: 32}
-```
-
-<a name="Oolong.clone" />
-### Oolong.clone(object)
-Creates a shallow clone of the given object, taking all enumerable
-properties into account.
-Shallow means if you've got nested objects, those will be shared.
-
-**Examples**:
-```javascript
-Oolong.clone({name: "John", age: 32})
-// => {name: "John", age: 32}
-```
-
-<a name="Oolong.cloneDeep" />
-### Oolong.cloneDeep(object)
-Creates a deep clone of the given object, taking all enumerable properties
-into account.
-
-**Examples**:
-```javascript
-Oolong.cloneDeep({name: "John", attributes: {age: 42}})
-// => {name: "John", attributes: {age: 42}}
-```
-
-<a name="Oolong.create" />
-### Oolong.create(prototype, [source...])
-Creates and returns an object inheriting from `prototype` and, optionally,
-assigns enumerable properties from `source` objects to the new object.
-Uses `Object.create` and [`Oolong.assign`](#Oolong.assign)
-internally.
-Does not modify the given `prototype` nor source objects.
-
-**Examples**:
-```javascript
-var PERSON = {name: "Unknown", age: 0}
-Oolong.create(PERSON, {name: "John"}, {shirt: "blue"})
-// => {name: "John", age: 0, shirt: "blue"}
-```
-
-<a name="Oolong.defaults" />
-### Oolong.defaults(target, source...)
-Assigns all enumerable properties on `source` objects to `target` that the
-`target` already _doesn't_ have. Uses `key in obj` to check for existence.
-Does not modify anything in the source objects.
-Returns `target`.
-
-Note that because **inherited properties** on `target` are checked, any
-property that exists on `Object.prototype` (e.g. `toString`, `valueOf`)
-will be skipped. Usually that's not a problem, but if you want to use
-`Oolong.defaults` for hashmaps/dictionaries with unknown keys, ensure
-`target` inherits from `null` instead (use `Object.create(null)`).
-
-**Examples**:
-```javascript
-var PERSON = {name: "Unknown", age: 0, shirt: "blue"}
-Oolong.defaults({name: "John", age: 42}, PERSON)
-// => {name: "John", age: 42, shirt: "blue"}
-```
-
-<a name="Oolong.defineGetter" />
-### Oolong.defineGetter(object, property, fn)
-Defines a getter on an object.
-Similar to [`Object.prototype.__defineGetter__`][__defineGetter__], but
-works in a standards compliant way.
-Returns `object`.
-
-The property is by default made *configurable* and *enumerable*. Should the
-property exist before, it's enumerability will be left as is.
-
-[__defineGetter__]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__
-
-**Examples**:
-```javascript
-var person = {birthyear: 1987}
-
-Oolong.defineGetter(person, "age", function() {
- return new Date().getFullYear() - this.birthyear
-})
-
-person.age // => 28 as of today in 2015.
-```
-
-<a name="Oolong.defineSetter" />
-### Oolong.defineSetter(object, property, fn)
-Defines a setter on an object.
-Similar to [`Object.prototype.__defineSetter__`][__defineSetter__], but
-works in a standards compliant way.
-Returns `object`.
-
-The property is by default made *configurable* and *enumerable*. Should the
-property exist before, it's enumerability will be left as is.
-
-[__defineSetter__]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__
-
-**Examples**:
-```javascript
-var person = {}
-
-Oolong.defineSetter(person, "age", function(age) {
- this.birthyear = new Date().getFullYear() - age
-})
-
-person.age = 28
-person.birthyear // => 1987 as of today in 2015.
-```
-
-<a name="Oolong.each" />
-### Oolong.each(object, callback, [thisArg])
-Calls the given function for all enumerable properties.
-Returns the given object.
-
-The function will be called with arguments `value`, `key` and `object` and
-bound to `thisArg`.
-
-**Examples**:
-```javascript
-var obj = {name: "John", age: 42}
-Oolong.each(obj, function(val, key) { console.log(key + "=" + val) })
-```
-
-<a name="Oolong.eachOwn" />
-### Oolong.eachOwn(object, callback, [thisArg])
-Calls the given function for all _own_ enumerable properties.
-Returns the given object.
-
-The function will be called with arguments `value`, `key` and `object` and
-bound to `thisArg`.
-
-**Examples**:
-```javascript
-var obj = {name: "John", age: 42}
-Oolong.eachOwn(obj, function(val, key) { console.log(key + "=" + val) })
-```
-
-<a name="Oolong.filter" />
-### Oolong.filter(object, callback, [thisArg])
-Filters all enumerable properties and returns a new object with only those
-properties for which the given function returned truthy for.
-
-The function will be called with arguments `value`, `key` and `object` and
-bound to `thisArg`.
-
-**Examples**:
-```javascript
-var obj = {a: 1, b: 2, c: 3, d: 4}
-Oolong.filter(obj, function(value, key) { return value % 2 == 0 })
-// => {b: 2, d: 4}
-```
-
-<a name="Oolong.forEach" />
-### Oolong.forEach(object, callback, [thisArg])
-Alias of [`each`](#Oolong.each).
-
-<a name="Oolong.forEachOwn" />
-### Oolong.forEachOwn(object, callback, [thisArg])
-Alias of [`eachOwn`](#Oolong.eachOwn).
-
-<a name="Oolong.has" />
-### Oolong.has(object, key)
-Checks whether the given object has the given property, inherited or not.
-Given a set, but `undefined` property will still return `true`.
-
-**Examples**:
-```javascript
-Oolong.has({name: "John"}) // => true
-Oolong.has(Object.create({name: "John"}), "name") // => true
-Oolong.has({}, "name") // => false
-```
-
-<a name="Oolong.hasOwn" />
-### Oolong.hasOwn(object, key)
-Checks whether the given object has the given property as an own property.
-Given a set, but `undefined` property will still return `true`.
-
-**Examples**:
-```javascript
-Oolong.hasOwn({name: "John"}) // => true
-Oolong.hasOwn(Object.create({name: "John"}), "name") // => false
-Oolong.hasOwn({}, "name") // => false
-```
-
-<a name="Oolong.isEmpty" />
-### Oolong.isEmpty(object)
-Checks whether the given object has any enumerable properties, inherited
-or not.
-
-**Examples**:
-```javascript
-Oolong.isEmpty({name: "John"}) // => false
-Oolong.isEmpty(Object.create({name: "John"})) // => false
-Oolong.isEmpty({}) // => true
-```
-
-<a name="Oolong.isIn" />
-### Oolong.isIn(object, key)
-Alias of [`has`](#Oolong.has).
-
-<a name="Oolong.isInOwn" />
-### Oolong.isInOwn(object, key)
-Alias of [`hasOwn`](#Oolong.hasOwn).
-
-<a name="Oolong.isObject" />
-### Oolong.isObject(object)
-Checks whether the given object is of type object and is not null.
-
-**Examples**:
-```javascript
-Oolong.isObject({name: "John"}) // => true
-Oolong.isObject(new Date) // => true
-Oolong.isObject(42) // => false
-Oolong.isObject(null) // => false
-```
-
-<a name="Oolong.isOwnEmpty" />
-### Oolong.isOwnEmpty(object)
-Checks whether the given object has any _own_ enumerable properties.
-
-**Examples**:
-```javascript
-Oolong.isOwnEmpty({name: "John"}) // => false
-Oolong.isOwnEmpty(Object.create({name: "John"})) // => true
-Oolong.isOwnEmpty({}) // => true
-```
-
-<a name="Oolong.isPlainObject" />
-### Oolong.isPlainObject(object)
-Checks whether the given object is one constructed by `Object` or inheriting
-from `null`.
-
-A non-plain object has a `constructor` property set to anything but `Object`.
-That's the case when you do, for example, `new MyModel`, `new Date`.
-
-`Array.prototype` is not considered a plain object just like an array isn't
-a plain object. JavaScript is a prototypical language and the prototype of
-an array should be considered an array.
-
-**Examples**:
-```javascript
-Oolong.isPlainObject({name: "John", age: 42}) // => true
-Oolong.isPlainObject(Object.create(null)) // => true
-Oolong.isPlainObject(Math) // => true
-Oolong.isPlainObject([]) // => false
-Oolong.isPlainObject(Array.prototype) // => false
-Oolong.isPlainObject(new Date) // => false
-Oolong.isPlainObject("John") // => false
-```
-
-<a name="Oolong.keys" />
-### Oolong.keys(object)
-Returns all enumerable keys of an object as an array.
-Similar to `Object.keys`, but takes inherited properties into account.
-
-**Examples**:
-```javascript
-Oolong.keys({name: "John", age: 32}) // => ["name", "age"]
-```
-
-<a name="Oolong.lookupGetter" />
-### Oolong.lookupGetter(object, property)
-Looks up and returns a getter on an object.
-Similar to [`Object.prototype.__lookupGetter__`][__lookupGetter__], but
-works in a standards compliant way.
-Takes inherited getters into account, just like `__lookupGetter__`.
-
-[__lookupGetter__]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__
-
-**Examples**:
-```javascript
-var person = {birthyear: 1987}
-
-Oolong.defineGetter(person, "age", function() {
- return new Date().getFullYear() - this.birthyear
-})
-
-Oolong.lookupGetter(person, "age") // Returns the function above.
-```
-
-<a name="Oolong.lookupSetter" />
-### Oolong.lookupSetter(object, property)
-Looks up and returns a setter on an object.
-Similar to [`Object.prototype.__lookupSetter__`][__lookupSetter__], but
-works in a standards compliant way.
-Takes inherited setters into account, just like `__lookupSetter__`.
-
-[__lookupSetter__]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__
-
-**Examples**:
-```javascript
-var person = {birthyear: 1987}
-
-Oolong.defineSetter(person, "age", function(age) {
- this.birthyear = new Date().getFullYear() - age
-})
-
-Oolong.lookupSetter(person, "age") // Returns the function above.
-```
-
-<a name="Oolong.map" />
-### Oolong.map(object, callback, [thisArg])
-Maps all enumerable property values and returns a new object.
-
-The function will be called with arguments `value`, `key` and `object` and
-bound to `thisArg`.
-
-**Examples**:
-```javascript
-var obj = {a: 1, b: 2, c: 3}
-Oolong.map(obj, function(value, key) { return value * 2 })
-// => {a: 2, b: 4, c: 6}
-```
-
-<a name="Oolong.mapKeys" />
-### Oolong.mapKeys(object, callback, [thisArg])
-Transforms all enumerable keys and returns a new object.
-
-The function will be called with arguments `key`, `value` and `object` and
-bound to `thisArg`.
-
-**Examples**:
-```javascript
-var person = {name: "John", age: 32}
-Oolong.mapKeys(person, function(key) { return key.toUpperCase() })
-// => {NAME: "John", AGE: 32}
-```
-
-<a name="Oolong.merge" />
-### Oolong.merge(target, source...)
-Assigns all enumerable properties on `source` objects to `target`
-recursively.
-Only plain objects a merged. Refer to
-[`Oolong.isPlainObject`](#Oolong.isPlainObject) for the definition of
-a plain object. Does not modify anything in the source objects.
-
-Think of it as _extending_ the first object step by step with others.
-
-**Examples**:
-```javascript
-var person = {name: "John", attributes: {age: 42}}
-Oolong.merge(person, {attributes: {height: 190}})
-person // => {name: "John", attributes: {age: 42, height: 190}}
-```
-
-<a name="Oolong.object" />
-### Oolong.object(keys, callback, [thisArg])
-Returns a new object with keys taken from the array `keys` and values
-from the result of calling the given function with `key`, `index` and
-`keys`.
-It's like the reverse of indexing an array.
-
-**Examples**:
-```javascript
-var names = ["Alice", "Bob", "Charlie"]
-var lengths = Oolong.object(names, function(name) { return name.length })
-lengths // => {Alice: 5, Bob: 3, Charlie: 7}
-```
-
-<a name="Oolong.ownKeys" />
-### Oolong.ownKeys(object)
-Returns all enumerable _own_ keys of an object as an array.
-Same as `Object.keys`, really.
-
-**Examples**:
-```javascript
-var person = Object.create({name: "John"})
-person.age = 42
-Oolong.ownKeys(person) // => ["age"]
-```
-
-<a name="Oolong.pick" />
-### Oolong.pick(object, keys...)
-Filters the keys of an object to only those given as `keys...`.
-Only keys that exist in `object` are included.
-
-**Examples**:
-```javascript
-var person = {name: "Alice", email: "alice@example.com", age: 42}
-Oolong.pick(person, "name", "age") // => {name: "Alice", age: 42}
-```
-
-<a name="Oolong.pickDeep" />
-### Oolong.pickDeep(object, keys...)
-Filters the keys of an object to only those given as `keys...` with support
-for nested keys in an array (`["a", "b", "c"]`).
-Only keys that exist in `object` are included.
-
-If you'd like to use some other path syntax, feel free to preprocess your
-keys before passing them to `pickDeep`. For example, for a period-separated
-syntax (`a.b.c`), use a helper:
-
-```javascript
-function path(s) { return s.split(".") }
-Oolong.pickDeep(person, "name", path("address.country"))
-```
-
-**Examples**:
-```javascript
-var person = {name: "Alice", address: {country: "UK", street: "Downing"}}
-var obj = Oolong.pickDeep(person, "name", ["address", "country"])
-obj // => {name: "Alice", address: {country: "UK"}}
-```
-
-<a name="Oolong.pluck" />
-### Oolong.pluck(object, key)
-Returns a new object with the same keys, but with values being the value's
-property `key`.
-In other words, it's the same as `Oolong.map(obj, Oolong.property(key))`.
-
-**Examples**:
-```javascript
-var people = {
- a: {name: "Alice"},
- b: {name: "Bob"},
- c: {name: "Charlie"}
-}
-
-Oolong.pluck(people, "name") // => {a: "Alice", b: "Bob", c: "Charlie"}
-```
-
-<a name="Oolong.property" />
-### Oolong.property(key)
-Returns a function that returns the given property of an object.
-
-**Examples**:
-```javascript
-var getName = Oolong.property("name")
-getName({name: "John"}) // => "John
-```
-
-<a name="Oolong.reject" />
-### Oolong.reject(object, callback, [thisArg])
-Rejects all enumerable properties and returns a new object without those
-properties for which the given function returned truthy for.
-Opposite of [`filter`](#Oolong.filter).
-
-The function will be called with arguments `value`, `key` and `object` and
-bound to `thisArg`.
-
-**Examples**:
-```javascript
-var obj = {a: 1, b: 2, c: 3, d: 4}
-Oolong.reject(obj, function(value, key) { return value % 2 == 0 })
-// => {a: 1, c: 3}
-```
-
-<a name="Oolong.setPrototypeOf" />
-### Oolong.setPrototypeOf(object, prototype)
-Set the prototype of the given object to the given prototype.
-Pass `null` or another object for the prototype.
-Returns `object`.
-
-Uses `Object.setPrototypeOf` if it exists. Otherwise uses a polyfill.
-
-**Examples**:
-```javascript
-var person = {name: "Unnamed", age: 42}
-var mike = Oolong.setPrototypeOf({name: "Mike"}, person)
-mike.name // => "Mike
-mike.age // => 42
-```
-
-<a name="Oolong.values" />
-### Oolong.values(object)
-Returns all enumerable property values as an array.
-
-**Examples**:
-```javascript
-Oolong.values({name: "John", age: 32}) // => ["John", 32]
-```
-
-<a name="Oolong.wrap" />
-### Oolong.wrap(value, key)
-Wraps a given value in an object under the specified key.
-Works also with [ECMAScript 6 Symbol](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Symbol).
-
-**Examples**:
-```javascript
-Oolong.wrap("John", "name") // => {name: "John"}
-```
diff --git a/oolong/index.js b/oolong/index.js
deleted file mode 100644
index 2848d1b..0000000
--- a/oolong/index.js
+++ /dev/null
@@ -1,836 +0,0 @@
-var hasOwn = Function.call.bind(Object.hasOwnProperty)
-var isEnumerable = Function.call.bind(Object.propertyIsEnumerable)
-var getPropertyDescriptor = require("./lib/es6").getPropertyDescriptor
-var lookupGetter = Object.prototype.__lookupGetter__
-var lookupSetter = Object.prototype.__lookupSetter__
-var isArray = Array.isArray
-var SET_PROTO_OF_NULL = "Oolong.setPrototypeOf called on null or undefined"
-
-/**
- * @class Oolong
- */
-
-/**
- * Assigns all enumerable properties on `source` objects to `target`.
- * Similar to `Object.assign`, but takes inherited properties into account.
- * Does not modify anything in the source objects.
- * Returns `target`.
- *
- * Think of it as _extending_ the first object step by step with others.
- *
- * @example
- * Oolong.assign({name: "John"}, {age: 32}, {shirt: "blue"})
- * // => {name: "John", age: 32, shirt: "blue"}
- *
- * @static
- * @method assign
- * @param target
- * @param source...
- */
-exports.assign = function assign(target) {
- if (target != null) for (var i = 1; i < arguments.length; ++i) {
- var source = arguments[i]
- for (var key in source) target[key] = source[key]
- }
-
- return target
-}
-
-/**
- * Assigns all own enumerable properties on `source` objects to `target`.
- * Like `Object.assign`. Does not modify anything in the source objects.
- * Returns `target`.
- *
- * Think of it as _extending_ the first object step by step with others.
- *
- * @example
- * Oolong.assignOwn({name: "John"}, {age: 32}, Object.create({shirt: "blue"}))
- * // => {name: "John", age: 32}
- *
- * @static
- * @method assignOwn
- * @param target
- * @param source...
- */
-exports.assignOwn = function assignOwn(target) {
- if (target != null) for (var i = 1; i < arguments.length; ++i) {
- var source = arguments[i]
- for (var key in source) if (hasOwn(source, key)) target[key] = source[key]
- }
-
- return target
-}
-
-/**
- * Creates a shallow clone of the given object, taking all enumerable
- * properties into account.
- * Shallow means if you've got nested objects, those will be shared.
- *
- * @example
- * Oolong.clone({name: "John", age: 32})
- * // => {name: "John", age: 32}
- *
- * @static
- * @method clone
- * @param object
- */
-exports.clone = function clone(obj) {
- return obj == null ? obj : exports.assign({}, obj)
-}
-
-/**
- * Creates a deep clone of the given object, taking all enumerable properties
- * into account.
- *
- * @example
- * Oolong.cloneDeep({name: "John", attributes: {age: 42}})
- * // => {name: "John", attributes: {age: 42}}
- *
- * @static
- * @method cloneDeep
- * @param object
- */
-exports.cloneDeep = function cloneDeep(obj) {
- return obj == null ? obj : exports.merge({}, obj)
-}
-
-/**
- * Creates and returns an object inheriting from `prototype` and, optionally,
- * assigns enumerable properties from `source` objects to the new object.
- * Uses `Object.create` and [`Oolong.assign`](#Oolong.assign)
- * internally.
- * Does not modify the given `prototype` nor source objects.
- *
- * @example
- * var PERSON = {name: "Unknown", age: 0}
- * Oolong.create(PERSON, {name: "John"}, {shirt: "blue"})
- * // => {name: "John", age: 0, shirt: "blue"}
- *
- * @static
- * @method create
- * @param prototype
- * @param [source...]
- */
-exports.create = function create(obj) {
- obj = arguments[0] = Object.create(obj)
- return arguments.length == 1 ? obj : exports.assign.apply(this, arguments)
-}
-
-/**
- * Assigns all enumerable properties on `source` objects to `target` that the
- * `target` already _doesn't_ have. Uses `key in obj` to check for existence.
- * Does not modify anything in the source objects.
- * Returns `target`.
- *
- * Note that because **inherited properties** on `target` are checked, any
- * property that exists on `Object.prototype` (e.g. `toString`, `valueOf`)
- * will be skipped. Usually that's not a problem, but if you want to use
- * `Oolong.defaults` for hashmaps/dictionaries with unknown keys, ensure
- * `target` inherits from `null` instead (use `Object.create(null)`).
- *
- * @example
- * var PERSON = {name: "Unknown", age: 0, shirt: "blue"}
- * Oolong.defaults({name: "John", age: 42}, PERSON)
- * // => {name: "John", age: 42, shirt: "blue"}
- *
- * @static
- * @method defaults
- * @param target
- * @param source...
- */
-exports.defaults = function defaults(target) {
- if (target != null) for (var i = 1; i < arguments.length; ++i) {
- var source = arguments[i]
- for (var key in source) if (!(key in target)) target[key] = source[key]
- }
-
- return target
-}
-
-/**
- * Defines a getter on an object.
- * Similar to [`Object.prototype.__defineGetter__`][__defineGetter__], but
- * works in a standards compliant way.
- * Returns `object`.
- *
- * The property is by default made *configurable* and *enumerable*. Should the
- * property exist before, it's enumerability will be left as is.
- *
- * [__defineGetter__]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__
- *
- * @example
- * var person = {birthyear: 1987}
- *
- * Oolong.defineGetter(person, "age", function() {
- * return new Date().getFullYear() - this.birthyear
- * })
- *
- * person.age // => 28 as of today in 2015.
- *
- * @static
- * @method defineGetter
- * @param object
- * @param property
- * @param fn
- */
-exports.defineGetter = function defineGetter(obj, name, fn) {
- return Object.defineProperty(obj, name, {
- get: fn,
- configurable: true,
- enumerable: !hasOwn(obj, name) || isEnumerable(obj, name)
- })
-}
-
-/**
- * Defines a setter on an object.
- * Similar to [`Object.prototype.__defineSetter__`][__defineSetter__], but
- * works in a standards compliant way.
- * Returns `object`.
- *
- * The property is by default made *configurable* and *enumerable*. Should the
- * property exist before, it's enumerability will be left as is.
- *
- * [__defineSetter__]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__
- *
- * @example
- * var person = {}
- *
- * Oolong.defineSetter(person, "age", function(age) {
- * this.birthyear = new Date().getFullYear() - age
- * })
- *
- * person.age = 28
- * person.birthyear // => 1987 as of today in 2015.
- *
- * @static
- * @method defineSetter
- * @param object
- * @param property
- * @param fn
- */
-exports.defineSetter = function defineSetter(obj, name, fn) {
- return Object.defineProperty(obj, name, {
- set: fn,
- configurable: true,
- enumerable: !hasOwn(obj, name) || isEnumerable(obj, name)
- })
-}
-
-/**
- * Calls the given function for all enumerable properties.
- * Returns the given object.
- *
- * The function will be called with arguments `value`, `key` and `object` and
- * bound to `thisArg`.
- *
- * @example
- * var obj = {name: "John", age: 42}
- * Oolong.each(obj, function(val, key) { console.log(key + "=" + val) })
- *
- * @static
- * @method each
- * @param object
- * @param callback
- * @param [thisArg]
- */
-exports.each = function each(obj, fn, context) {
- for (var key in obj) fn.call(context, obj[key], key, obj)
- return obj
-}
-
-/**
- * Calls the given function for all _own_ enumerable properties.
- * Returns the given object.
- *
- * The function will be called with arguments `value`, `key` and `object` and
- * bound to `thisArg`.
- *
- * @example
- * var obj = {name: "John", age: 42}
- * Oolong.eachOwn(obj, function(val, key) { console.log(key + "=" + val) })
- *
- * @static
- * @method eachOwn
- * @param object
- * @param callback
- * @param [thisArg]
- */
-exports.eachOwn = function eachOwn(obj, fn, context) {
- for (var key in obj)
- if (hasOwn(obj, key)) fn.call(context, obj[key], key, obj)
-
- return obj
-}
-
-/**
- * Filters all enumerable properties and returns a new object with only those
- * properties for which the given function returned truthy for.
- *
- * The function will be called with arguments `value`, `key` and `object` and
- * bound to `thisArg`.
- *
- * @example
- * var obj = {a: 1, b: 2, c: 3, d: 4}
- * Oolong.filter(obj, function(value, key) { return value % 2 == 0 })
- * // => {b: 2, d: 4}
- *
- * @static
- * @method filter
- * @param object
- * @param callback
- * @param [thisArg]
- */
-exports.filter = function filter(obj, fn, context) {
- var filtered = {}
-
- for (var key in obj) {
- var value = obj[key]
- if (fn.call(context, value, key, obj)) filtered[key] = value
- }
-
- return filtered
-}
-
-/**
- * @static
- * @method forEach
- * @alias each
- */
-exports.forEach = exports.each
-
-/**
- * @static
- * @method forEachOwn
- * @alias eachOwn
- */
-exports.forEachOwn = exports.eachOwn
-
-/**
- * Checks whether the given object has the given property, inherited or not.
- * Given a set, but `undefined` property will still return `true`.
- *
- * @example
- * Oolong.has({name: "John"}) // => true
- * Oolong.has(Object.create({name: "John"}), "name") // => true
- * Oolong.has({}, "name") // => false
- *
- * @static
- * @method has
- * @param object
- * @param key
- */
-exports.has = function has(obj, key) {
- return key in obj
-}
-
-/**
- * Checks whether the given object has the given property as an own property.
- * Given a set, but `undefined` property will still return `true`.
- *
- * @example
- * Oolong.hasOwn({name: "John"}) // => true
- * Oolong.hasOwn(Object.create({name: "John"}), "name") // => false
- * Oolong.hasOwn({}, "name") // => false
- *
- * @static
- * @method hasOwn
- * @param object
- * @param key
- */
-exports.hasOwn = hasOwn
-
-/**
- * Checks whether the given object has any enumerable properties, inherited
- * or not.
- *
- * @example
- * Oolong.isEmpty({name: "John"}) // => false
- * Oolong.isEmpty(Object.create({name: "John"})) // => false
- * Oolong.isEmpty({}) // => true
- *
- * @static
- * @method isEmpty
- * @param object
- */
-exports.isEmpty = function isEmpty(obj) {
- for (obj in obj) return false
- return true
-}
-
-/**
- * @static
- * @method isIn
- * @alias has
- */
-exports.isIn = exports.has
-
-/**
- * @static
- * @method isInOwn
- * @alias hasOwn
- */
-exports.isInOwn = exports.hasOwn
-
-/**
- * Checks whether the given object is of type object and is not null.
- *
- * @example
- * Oolong.isObject({name: "John"}) // => true
- * Oolong.isObject(new Date) // => true
- * Oolong.isObject(42) // => false
- * Oolong.isObject(null) // => false
- *
- * @static
- * @method isObject
- * @param object
- */
-exports.isObject = function isObject(obj) {
- return obj != null && typeof obj == "object"
-}
-
-/**
- * Checks whether the given object has any _own_ enumerable properties.
- *
- * @example
- * Oolong.isOwnEmpty({name: "John"}) // => false
- * Oolong.isOwnEmpty(Object.create({name: "John"})) // => true
- * Oolong.isOwnEmpty({}) // => true
- *
- * @static
- * @method isOwnEmpty
- * @param object
- */
-exports.isOwnEmpty = function isOwnEmpty(obj) {
- for (var key in obj) if (hasOwn(obj, key)) return false
- return true
-}
-
-/**
- * Checks whether the given object is one constructed by `Object` or inheriting
- * from `null`.
- *
- * A non-plain object has a `constructor` property set to anything but `Object`.
- * That's the case when you do, for example, `new MyModel`, `new Date`.
- *
- * `Array.prototype` is not considered a plain object just like an array isn't
- * a plain object. JavaScript is a prototypical language and the prototype of
- * an array should be considered an array.
- *
- * @example
- * Oolong.isPlainObject({name: "John", age: 42}) // => true
- * Oolong.isPlainObject(Object.create(null)) // => true
- * Oolong.isPlainObject(Math) // => true
- * Oolong.isPlainObject([]) // => false
- * Oolong.isPlainObject(Array.prototype) // => false
- * Oolong.isPlainObject(new Date) // => false
- * Oolong.isPlainObject("John") // => false
- *
- * @static
- * @method isPlainObject
- * @param object
- */
-exports.isPlainObject = function isPlainObject(obj) {
- if (obj == null) return false
- if (typeof obj != "object") return false
- if (isArray(obj)) return false
-
- var prototype = Object.getPrototypeOf(obj)
- if (prototype === null) return true
- if (!("constructor" in prototype)) return true
- return prototype.constructor === Object
-}
-
-/**
- * Returns all enumerable keys of an object as an array.
- * Similar to `Object.keys`, but takes inherited properties into account.
- *
- * @example
- * Oolong.keys({name: "John", age: 32}) // => ["name", "age"]
- *
- * @static
- * @method keys
- * @param object
- */
-exports.keys = function keys(obj) {
- var keys = []
- for (var key in obj) keys.push(key)
- return keys
-}
-
-/**
- * Looks up and returns a getter on an object.
- * Similar to [`Object.prototype.__lookupGetter__`][__lookupGetter__], but
- * works in a standards compliant way.
- * Takes inherited getters into account, just like `__lookupGetter__`.
- *
- * [__lookupGetter__]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__
- *
- * @example
- * var person = {birthyear: 1987}
- *
- * Oolong.defineGetter(person, "age", function() {
- * return new Date().getFullYear() - this.birthyear
- * })
- *
- * Oolong.lookupGetter(person, "age") // Returns the function above.
- *
- * @static
- * @method lookupGetter
- * @param object
- * @param property
- */
-exports.lookupGetter = lookupGetter ? Function.call.bind(lookupGetter) :
- function lookupSetter(obj, name) {
- var desc = getPropertyDescriptor(obj, name)
- return desc && desc.get
-}
-
-/**
- * Looks up and returns a setter on an object.
- * Similar to [`Object.prototype.__lookupSetter__`][__lookupSetter__], but
- * works in a standards compliant way.
- * Takes inherited setters into account, just like `__lookupSetter__`.
- *
- * [__lookupSetter__]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__
- *
- * @example
- * var person = {birthyear: 1987}
- *
- * Oolong.defineSetter(person, "age", function(age) {
- * this.birthyear = new Date().getFullYear() - age
- * })
- *
- * Oolong.lookupSetter(person, "age") // Returns the function above.
- *
- * @static
- * @method lookupSetter
- * @param object
- * @param property
- */
-exports.lookupSetter = lookupSetter ? Function.call.bind(lookupSetter) :
- function lookupSetter(obj, name) {
- var desc = getPropertyDescriptor(obj, name)
- return desc && desc.set
-}
-
-/**
- * Maps all enumerable property values and returns a new object.
- *
- * The function will be called with arguments `value`, `key` and `object` and
- * bound to `thisArg`.
- *
- * @example
- * var obj = {a: 1, b: 2, c: 3}
- * Oolong.map(obj, function(value, key) { return value * 2 })
- * // => {a: 2, b: 4, c: 6}
- *
- * @static
- * @method map
- * @param object
- * @param callback
- * @param [thisArg]
- */
-exports.map = function map(obj, fn, context) {
- var mapped = {}
- for (var key in obj) mapped[key] = fn.call(context, obj[key], key, obj)
- return mapped
-}
-
-/**
- * Transforms all enumerable keys and returns a new object.
- *
- * The function will be called with arguments `key`, `value` and `object` and
- * bound to `thisArg`.
- *
- * @example
- * var person = {name: "John", age: 32}
- * Oolong.mapKeys(person, function(key) { return key.toUpperCase() })
- * // => {NAME: "John", AGE: 32}
- *
- * @static
- * @method mapKeys
- * @param object
- * @param callback
- * @param [thisArg]
- */
-exports.mapKeys = function mapKeys(obj, fn, context) {
- var result = {}
-
- for (var key in obj) {
- var value = obj[key]
- result[fn.call(context, key, value, obj)] = value
- }
-
- return result
-}
-
-/**
- * Assigns all enumerable properties on `source` objects to `target`
- * recursively.
- * Only plain objects a merged. Refer to
- * [`Oolong.isPlainObject`](#Oolong.isPlainObject) for the definition of
- * a plain object. Does not modify anything in the source objects.
- *
- * Think of it as _extending_ the first object step by step with others.
- *
- * @example
- * var person = {name: "John", attributes: {age: 42}}
- * Oolong.merge(person, {attributes: {height: 190}})
- * person // => {name: "John", attributes: {age: 42, height: 190}}
- *
- * @static
- * @method merge
- * @param target
- * @param source...
- */
-exports.merge = function merge(target) {
- if (target != null) for (var i = 1; i < arguments.length; ++i) {
- var source = arguments[i]
-
- for (var key in source) {
- var a = target[key]
- var b = source[key]
- var aIsObject = exports.isPlainObject(a)
- var bIsObject = exports.isPlainObject(b)
-
- if (aIsObject && bIsObject) merge(a, b)
- else if (bIsObject) target[key] = merge({}, b)
- else target[key] = b
- }
- }
-
- return target
-}
-
-/**
- * Returns a new object with keys taken from the array `keys` and values
- * from the result of calling the given function with `key`, `index` and
- * `keys`.
- * It's like the reverse of indexing an array.
- *
- * @example
- * var names = ["Alice", "Bob", "Charlie"]
- * var lengths = Oolong.object(names, function(name) { return name.length })
- * lengths // => {Alice: 5, Bob: 3, Charlie: 7}
- *
- * @static
- * @method object
- * @param keys
- * @param callback
- * @param [thisArg]
- */
-exports.object = function object(keys, fn, thisArg) {
- var obj = {}
-
- for (var i = 0; i < keys.length; ++i) {
- var key = keys[i]
- obj[key] = fn.call(thisArg, key, i, keys)
- }
-
- return obj
-}
-
-/**
- * Returns all enumerable _own_ keys of an object as an array.
- * Same as `Object.keys`, really.
- *
- * @example
- * var person = Object.create({name: "John"})
- * person.age = 42
- * Oolong.ownKeys(person) // => ["age"]
- *
- * @static
- * @method ownKeys
- * @param object
- */
-exports.ownKeys = Object.keys
-
-/**
- * Filters the keys of an object to only those given as `keys...`.
- * Only keys that exist in `object` are included.
- *
- * @example
- * var person = {name: "Alice", email: "alice@example.com", age: 42}
- * Oolong.pick(person, "name", "age") // => {name: "Alice", age: 42}
- *
- * @static
- * @method pick
- * @param object
- * @param keys...
- *
- */
-exports.pick = function pick(obj) {
- var target = {}
-
- for (var i = 1; i < arguments.length; ++i) {
- var key = arguments[i]
- if (key in obj) target[key] = obj[key]
- }
-
- return target
-}
-
-/**
- * Filters the keys of an object to only those given as `keys...` with support
- * for nested keys in an array (`["a", "b", "c"]`).
- * Only keys that exist in `object` are included.
- *
- * If you'd like to use some other path syntax, feel free to preprocess your
- * keys before passing them to `pickDeep`. For example, for a period-separated
- * syntax (`a.b.c`), use a helper:
- *
- * ```javascript
- * function path(s) { return s.split(".") }
- * Oolong.pickDeep(person, "name", path("address.country"))
- * ```
- *
- * @example
- * var person = {name: "Alice", address: {country: "UK", street: "Downing"}}
- * var obj = Oolong.pickDeep(person, "name", ["address", "country"])
- * obj // => {name: "Alice", address: {country: "UK"}}
- *
- * @static
- * @method pickDeep
- * @param object
- * @param keys...
- *
- */
-exports.pickDeep = function pickDeep(obj) {
- var target = {}
-
- for (var i = 1; i < arguments.length; ++i) {
- var keys = arrayify(arguments[i]), length = keys.length
- var key, value = obj, t = target, j
-
- for (j = 0; j < length && (key = keys[j]) in value; ++j) value = value[key]
- if (j !== length) continue
- for (j = 0; j < length - 1; ++j) t = t[keys[j]] || (t[keys[j]] = {})
- t[keys[j]] = value
- }
-
- return target
-}
-
-/**
- * Returns a new object with the same keys, but with values being the value's
- * property `key`.
- * In other words, it's the same as `Oolong.map(obj, Oolong.property(key))`.
- *
- * @example
- * var people = {
- * a: {name: "Alice"},
- * b: {name: "Bob"},
- * c: {name: "Charlie"}
- * }
- *
- * Oolong.pluck(people, "name") // => {a: "Alice", b: "Bob", c: "Charlie"}
- *
- * @static
- * @method pluck
- * @param object
- * @param key
- */
-exports.pluck = function pluck(obj, key) {
- return exports.map(obj, exports.property(key))
-}
-
-/**
- * Returns a function that returns the given property of an object.
- *
- * @example
- * var getName = Oolong.property("name")
- * getName({name: "John"}) // => "John
- *
- * @static
- * @method property
- * @param key
- */
-exports.property = function property(key) {
- return function(obj) { return obj[key] }
-}
-
-/**
- * Rejects all enumerable properties and returns a new object without those
- * properties for which the given function returned truthy for.
- * Opposite of [`filter`](#Oolong.filter).
- *
- * The function will be called with arguments `value`, `key` and `object` and
- * bound to `thisArg`.
- *
- * @example
- * var obj = {a: 1, b: 2, c: 3, d: 4}
- * Oolong.reject(obj, function(value, key) { return value % 2 == 0 })
- * // => {a: 1, c: 3}
- *
- * @static
- * @method reject
- * @param object
- * @param callback
- * @param [thisArg]
- */
-exports.reject = function reject(obj, fn, context) {
- return exports.filter(obj, not(fn), context)
-}
-
-/**
- * Set the prototype of the given object to the given prototype.
- * Pass `null` or another object for the prototype.
- * Returns `object`.
- *
- * Uses `Object.setPrototypeOf` if it exists. Otherwise uses a polyfill.
- *
- * @example
- * var person = {name: "Unnamed", age: 42}
- * var mike = Oolong.setPrototypeOf({name: "Mike"}, person)
- * mike.name // => "Mike
- * mike.age // => 42
- *
- * @static
- * @method setPrototypeOf
- * @param object
- * @param prototype
- */
-exports.setPrototypeOf = Object.setPrototypeOf ||
- function setPrototypeOf(obj, prototype) {
- /* eslint no-proto: 0 */
- if (obj == null) throw new TypeError(SET_PROTO_OF_NULL)
- if (typeof obj == "object") obj.__proto__ = prototype
- return obj
-}
-
-/**
- * Returns all enumerable property values as an array.
- *
- * @example
- * Oolong.values({name: "John", age: 32}) // => ["John", 32]
- *
- * @static
- * @method values
- * @param object
- */
-exports.values = function values(obj) {
- var values = []
- for (var key in obj) values.push(obj[key])
- return values
-}
-
-/**
- * Wraps a given value in an object under the specified key.
- * Works also with [ECMAScript 6 Symbol](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Symbol).
- *
- * @example
- * Oolong.wrap("John", "name") // => {name: "John"}
- *
- * @static
- * @method wrap
- * @param value
- * @param key
- */
-exports.wrap = function wrap(value, key) {
- var obj = {}
- obj[key] = value
- return obj
-}
-
-function not(fn) { return function() { return !fn.apply(this, arguments) }}
-function arrayify(value) { return isArray(value) ? value : [value] }
diff --git a/oolong/lib/es6.js b/oolong/lib/es6.js
deleted file mode 100644
index a3358e5..0000000
--- a/oolong/lib/es6.js
+++ /dev/null
@@ -1,8 +0,0 @@
-exports.getPropertyDescriptor = Object.getPropertyDescriptor ||
- function(obj, name) {
- if (!(name in obj)) return
-
- var desc
- do { if (desc = Object.getOwnPropertyDescriptor(obj, name)) return desc }
- while (obj = Object.getPrototypeOf(obj))
-}
diff --git a/oolong/package.json b/oolong/package.json
deleted file mode 100644
index d4dab4d..0000000
--- a/oolong/package.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "oolong",
- "version": "1.15.1",
- "description": "Utilities for objects. Simple, tasteful and plentiful. Supports inherited properties.",
- "keywords": [
- "functional",
- "underscore",
- "util"
- ],
- "homepage": "https://github.com/moll/js-oolong",
- "bugs": "https://github.com/moll/js-oolong/issues",
-
- "author": {
- "name": "Andri Möll",
- "email": "andri@dot.ee",
- "url": "http://themoll.com"
- },
-
- "repository": {
- "type": "git",
- "url": "git://github.com/moll/js-oolong.git"
- },
-
- "licenses": [{
- "type": "LAGPL",
- "url": "https://github.com/moll/js-oolong/blob/master/LICENSE"
- }],
-
- "main": "index.js",
- "scripts": {"test": "make test NODE_OPTS="},
-
- "devDependencies": {
- "mocha": ">= 2.5.3 < 3",
- "must": ">= 0.13.2 < 0.14",
- "sinon": ">= 1.10.3 < 2"
- }
-}
diff --git a/oolong/test/mocha.opts b/oolong/test/mocha.opts
deleted file mode 100644
index 2661ca1..0000000
--- a/oolong/test/mocha.opts
+++ /dev/null
@@ -1,3 +0,0 @@
---recursive
---require must
---check-leaks
diff --git a/oolong/test/oolong/assign_own_test.js b/oolong/test/oolong/assign_own_test.js
deleted file mode 100644
index bc60c60..0000000
--- a/oolong/test/oolong/assign_own_test.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.assignOwn", function() {
- it("must return undefined given nothing", function() {
- demand(O.assignOwn()).be.undefined()
- })
-
- it("must return null given null", function() {
- demand(O.assignOwn(null)).be.null()
- })
-
- it("must return undefined given undefined and a source", function() {
- demand(O.assignOwn(undefined, {name: "John"})).be.undefined()
- })
-
- it("must return null given null and a source", function() {
- demand(O.assignOwn(null, {name: "John"})).be.null()
- })
-
- it("must return target given no source", function() {
- var obj = {}
- O.assignOwn(obj).must.equal(obj)
- })
-
- it("must return target given one source", function() {
- var obj = {}
- O.assignOwn(obj, {name: "John"}).must.equal(obj)
- })
-
- it("must assign properties to target from one source", function() {
- O.assignOwn({}, {name: "John"}).must.eql({name: "John"})
- })
-
- it("must assign properties to target from two sources", function() {
- O.assignOwn({}, {name: "John"}, {age: 13}).must.eql({name: "John", age: 13})
- })
-
- it("must overwrite property with later source", function() {
- O.assignOwn({}, {name: "John"}, {name: "Mike"}).must.eql({name: "Mike"})
- })
-
- it("must not change target given no source", function() {
- O.assignOwn({name: "John"}).must.eql({name: "John"})
- })
-
- it("must not assign properties from inherited sources", function() {
- O.assignOwn({}, Object.create({name: "John"})).must.eql({})
- })
-
- it("must not assign unenumerable properties", function() {
- var source = Object.defineProperty({}, "name", {value: "John"})
- O.assignOwn({}, source).must.eql({})
- })
-
- it("must assign properties with undefined value", function() {
- O.assignOwn({name: "John"}, {name: undefined}).must.eql({name: undefined})
- })
-})
diff --git a/oolong/test/oolong/assign_test.js b/oolong/test/oolong/assign_test.js
deleted file mode 100644
index 0adf645..0000000
--- a/oolong/test/oolong/assign_test.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.assign", function() {
- it("must return undefined given nothing", function() {
- demand(O.assign()).be.undefined()
- })
-
- it("must return null given null", function() {
- demand(O.assign(null)).be.null()
- })
-
- it("must return undefined given undefined and a source", function() {
- demand(O.assign(undefined, {name: "John"})).be.undefined()
- })
-
- it("must return null given null and a source", function() {
- demand(O.assign(null, {name: "John"})).be.null()
- })
-
- it("must return target given no source", function() {
- var obj = {}
- O.assign(obj).must.equal(obj)
- })
-
- it("must return target given one source", function() {
- var obj = {}
- O.assign(obj, {name: "John"}).must.equal(obj)
- })
-
- it("must assign properties to target from one source", function() {
- O.assign({}, {name: "John"}).must.eql({name: "John"})
- })
-
- it("must assign properties to target from two sources", function() {
- O.assign({}, {name: "John"}, {age: 13}).must.eql({name: "John", age: 13})
- })
-
- it("must overwrite property with later source", function() {
- O.assign({}, {name: "John"}, {name: "Mike"}).must.eql({name: "Mike"})
- })
-
- it("must not change target given no source", function() {
- O.assign({name: "John"}).must.eql({name: "John"})
- })
-
- it("must assign properties from inherited sources", function() {
- O.assign({}, Object.create({name: "John"})).must.eql({name: "John"})
- })
-
- it("must not assign unenumerable properties", function() {
- var source = Object.defineProperty({}, "name", {value: "John"})
- O.assign({}, source).must.eql({})
- })
-
- it("must assign properties with undefined value", function() {
- O.assign({name: "John"}, {name: undefined}).must.eql({name: undefined})
- })
-})
diff --git a/oolong/test/oolong/clone_deep_test.js b/oolong/test/oolong/clone_deep_test.js
deleted file mode 100644
index 913acb7..0000000
--- a/oolong/test/oolong/clone_deep_test.js
+++ /dev/null
@@ -1,55 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.cloneDeep", function() {
- it("must return undefined given nothing", function() {
- demand(O.cloneDeep()).be.undefined()
- })
-
- it("must return undefined given undefined", function() {
- demand(O.cloneDeep(undefined)).be.undefined()
- })
-
- it("must return null given null", function() {
- demand(O.cloneDeep(null)).be.null()
- })
-
- it("must return new object", function() {
- var obj = {}
- O.cloneDeep(obj).must.not.equal(obj)
- })
-
- it("must return new object given nested objects", function() {
- var obj = {attributes: {}}
- O.cloneDeep(obj).attributes.must.not.equal(obj.attributes)
- })
-
- it("must clone properties", function() {
- O.cloneDeep({name: "John", age: 42}).must.eql({name: "John", age: 42})
- })
-
- it("must clone nested properties", function() {
- var obj = {name: "John", attributes: {age: 13}}
- O.cloneDeep(obj).must.eql({name: "John", attributes: {age: 13}})
- })
-
- it("must assign functions", function() {
- function fn() {}
- O.cloneDeep({fn: fn}).must.eql({fn: fn})
- })
-
- it("must clone properties from inherited sources", function() {
- O.cloneDeep(Object.create({name: "John"})).must.eql({name: "John"})
- })
-
- it("must not clone unenumerable properties", function() {
- var source = Object.defineProperty({}, "name", {value: "John"})
- O.cloneDeep(source).must.eql({})
- })
-
- // Just to ensure the target isn't shared between invocations.
- it("must clone properties when called twice", function() {
- O.cloneDeep({name: "John"})
- O.cloneDeep({age: 42}).must.eql({age: 42})
- })
-})
diff --git a/oolong/test/oolong/clone_test.js b/oolong/test/oolong/clone_test.js
deleted file mode 100644
index bebdcad..0000000
--- a/oolong/test/oolong/clone_test.js
+++ /dev/null
@@ -1,51 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.clone", function() {
- it("must return undefined given nothing", function() {
- demand(O.clone()).be.undefined()
- })
-
- it("must return undefined given undefined", function() {
- demand(O.clone(undefined)).be.undefined()
- })
-
- it("must return null given null", function() {
- demand(O.clone(null)).be.null()
- })
-
- it("must return new object", function() {
- var obj = {}
- O.clone(obj).must.not.equal(obj)
- })
-
- it("must clone properties", function() {
- O.clone({name: "John", age: 42}).must.eql({name: "John", age: 42})
- })
-
- it("must assign nested properties", function() {
- var attrs = {age: 42}
- var obj = O.clone({name: "John", attrs: attrs})
- obj.attrs.must.equal(attrs)
- })
-
- it("must assign functions", function() {
- function fn() {}
- O.clone({fn: fn}).must.eql({fn: fn})
- })
-
- it("must clone properties from inherited sources", function() {
- O.clone(Object.create({name: "John"})).must.eql({name: "John"})
- })
-
- it("must not clone unenumerable properties", function() {
- var source = Object.defineProperty({}, "name", {value: "John"})
- O.clone(source).must.eql({})
- })
-
- // Just to ensure the target isn't shared between invocations.
- it("must clone properties when called twice", function() {
- O.clone({name: "John"})
- O.clone({age: 42}).must.eql({age: 42})
- })
-})
diff --git a/oolong/test/oolong/create_test.js b/oolong/test/oolong/create_test.js
deleted file mode 100644
index 16d3b33..0000000
--- a/oolong/test/oolong/create_test.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.create", function() {
- it("must return an object inheriting from the one given", function() {
- var prototype = {}
- var obj = O.create(prototype)
- Object.getPrototypeOf(obj).must.equal(prototype)
- })
-
- it("must return an object inheriting from null if given", function() {
- var obj = O.create(null)
- demand(Object.getPrototypeOf(obj)).be.null()
- })
-
- it("must assign properties to target from one source", function() {
- O.create({}, {name: "John"}).must.eql({name: "John"})
- })
-
- it("must assign properties to target from two sources", function() {
- var obj = O.create({}, {name: "John"}, {age: 13})
- obj.must.eql({name: "John", age: 13})
- })
-
- it("must throw TypeError given nothing", function() {
- var err
- try { O.create() } catch (ex) { err = ex }
- err.must.be.an.instanceof(TypeError)
- })
-
- it("must not modify the given prototype", function() {
- var prototype = {name: ""}
- O.create(prototype, {name: "John"})
- prototype.must.eql({name: ""})
- })
-})
diff --git a/oolong/test/oolong/defaults_test.js b/oolong/test/oolong/defaults_test.js
deleted file mode 100644
index 069155f..0000000
--- a/oolong/test/oolong/defaults_test.js
+++ /dev/null
@@ -1,73 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.defaults", function() {
- it("must return undefined given nothing", function() {
- demand(O.defaults()).be.undefined()
- })
-
- it("must return null given null", function() {
- demand(O.defaults(null)).be.null()
- })
-
- it("must return undefined given undefined and a source", function() {
- demand(O.defaults(undefined, {name: "John"})).be.undefined()
- })
-
- it("must return null given null and a source", function() {
- demand(O.defaults(null, {name: "John"})).be.null()
- })
-
- it("must return target given no source", function() {
- var obj = {}
- O.defaults(obj).must.equal(obj)
- })
-
- it("must return target given one source", function() {
- var obj = {}
- O.defaults(obj, {name: "John"}).must.equal(obj)
- })
-
- it("must assign properties to target from one source", function() {
- O.defaults({}, {name: "John"}).must.eql({name: "John"})
- })
-
- it("must assign properties to target from two sources", function() {
- O.defaults({}, {name: "John"}, {age: 13}).must.eql({name: "John", age: 13})
- })
-
- it("must not assign properties in Object.prototype", function() {
- O.defaults({}, {hasOwnProperty: true}).must.eql({})
- })
-
- it("must assign properties in Object.prototype when inheriting from null",
- function() {
- var obj = O.defaults(Object.create(null), {hasOwnProperty: true})
- demand(obj).eql({hasOwnProperty: true})
- })
-
- it("must not overwrite property if target already has it", function() {
- O.defaults({name: "John"}, {name: "Mike"}).must.eql({name: "John"})
- })
-
- it("must not overwrite property with later source", function() {
- O.defaults({}, {name: "John"}, {name: "Mike"}).must.eql({name: "John"})
- })
-
- it("must not change target given no source", function() {
- O.defaults({name: "John"}).must.eql({name: "John"})
- })
-
- it("must assign properties from inherited sources", function() {
- O.defaults({}, Object.create({name: "John"})).must.eql({name: "John"})
- })
-
- it("must not assign unenumerable properties", function() {
- var source = Object.defineProperty({}, "name", {value: "John"})
- O.defaults({}, source).must.eql({})
- })
-
- it("must assign properties with undefined value", function() {
- O.defaults({}, {name: undefined}).must.eql({name: undefined})
- })
-})
diff --git a/oolong/test/oolong/define_getter_test.js b/oolong/test/oolong/define_getter_test.js
deleted file mode 100644
index f502392..0000000
--- a/oolong/test/oolong/define_getter_test.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.defineGetter", function() {
- it("must return object", function() {
- var obj = {}
- O.defineGetter(obj, "name", getter).must.equal(obj)
- })
-
- it("must define a getter", function() {
- var obj = O.defineGetter({}, "name", getter)
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.get.must.equal(getter)
- desc.enumerable.must.be.true()
- desc.configurable.must.be.true()
- })
-
- it("must not define setter", function() {
- var obj = O.defineGetter({}, "name", getter)
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.must.have.property("set", undefined)
- })
-
- it("must not remove setter", function() {
- var obj = {}
- O.defineSetter(obj, "name", setter)
- O.defineGetter(obj, "name", getter)
-
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.get.must.equal(getter)
- desc.set.must.equal(setter)
- })
-
- it("must define property as enumerable if previously so", function() {
- var obj = Object.defineProperty({}, "name", {
- writable: true, configurable: true, enumerable: true, value: "John"
- })
-
- O.defineGetter(obj, "name", getter)
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.get.must.equal(getter)
- desc.enumerable.must.be.true()
- desc.configurable.must.be.true()
- })
-
- // This differs how __defineGetter__ works, but I'd say it's more in line
- // with how Object.defineProperty behaves.
- it("must not define property as enumerable if previously not", function() {
- var obj = Object.defineProperty({}, "name", {
- writable: true, configurable: true, value: "John"
- })
-
- O.defineGetter(obj, "name", getter)
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.get.must.equal(getter)
- desc.enumerable.must.be.false()
- desc.configurable.must.be.true()
- })
-})
-
-function setter() {}
-function getter() {}
diff --git a/oolong/test/oolong/define_setter_test.js b/oolong/test/oolong/define_setter_test.js
deleted file mode 100644
index 3f10145..0000000
--- a/oolong/test/oolong/define_setter_test.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.defineSetter", function() {
- it("must return object", function() {
- var obj = {}
- O.defineSetter(obj, "name", setter).must.equal(obj)
- })
-
- it("must define a setter", function() {
- var obj = O.defineSetter({}, "name", setter)
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.set.must.equal(setter)
- desc.enumerable.must.be.true()
- desc.configurable.must.be.true()
- })
-
- it("must not define getter", function() {
- var obj = O.defineSetter({}, "name", setter)
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.must.have.property("get", undefined)
- })
-
- it("must not remove getter", function() {
- var obj = {}
- O.defineGetter(obj, "name", getter)
- O.defineSetter(obj, "name", setter)
-
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.get.must.equal(getter)
- desc.set.must.equal(setter)
- })
-
- it("must define property as enumerable if previously so", function() {
- var obj = Object.defineProperty({}, "name", {
- writable: true, configurable: true, enumerable: true, value: "John"
- })
-
- O.defineSetter(obj, "name", setter)
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.set.must.equal(setter)
- desc.enumerable.must.be.true()
- desc.configurable.must.be.true()
- })
-
- // This differs how __defineSetter__ works, but I'd say it's more in line
- // with how Object.defineProperty behaves.
- it("must not define property as enumerable if previously not", function() {
- var obj = Object.defineProperty({}, "name", {
- writable: true, configurable: true, value: "John"
- })
-
- O.defineSetter(obj, "name", setter)
- var desc = Object.getOwnPropertyDescriptor(obj, "name")
- desc.set.must.equal(setter)
- desc.enumerable.must.be.false()
- desc.configurable.must.be.true()
- })
-})
-
-function getter() {}
-function setter() {}
diff --git a/oolong/test/oolong/each_own_test.js b/oolong/test/oolong/each_own_test.js
deleted file mode 100644
index 60bc676..0000000
--- a/oolong/test/oolong/each_own_test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-var O = require("../..")
-var Sinon = require("sinon")
-
-describe("Oolong.eachOwn", function() {
- it("must call function with value, key and object", function() {
- var obj = {name: "John", age: 42, height: 190}
- var spy = Sinon.spy()
- var context = {}
- O.eachOwn(obj, spy, context)
-
- spy.callCount.must.equal(3)
- spy.args[0][0].must.equal("John")
- spy.args[0][1].must.equal("name")
- spy.args[0][2].must.equal(obj)
- spy.thisValues[0].must.equal(context)
- spy.args[1][0].must.equal(42)
- spy.args[1][1].must.equal("age")
- spy.args[1][2].must.equal(obj)
- spy.thisValues[1].must.equal(context)
- spy.args[2][0].must.equal(190)
- spy.args[2][1].must.equal("height")
- spy.args[2][2].must.equal(obj)
- spy.thisValues[2].must.equal(context)
- })
-
- it("must call function only for own properties", function() {
- var obj = Object.create({name: "John"})
- obj.age = 42
- var spy = Sinon.spy()
- var context = {}
- O.eachOwn(obj, spy, context)
-
- spy.callCount.must.equal(1)
- spy.args[0][0].must.equal(42)
- spy.args[0][1].must.equal("age")
- spy.args[0][2].must.equal(obj)
- spy.thisValues[0].must.equal(context)
- })
-
- it("must return the given object", function() {
- var obj = {}
- O.eachOwn(obj, noop).must.equal(obj)
- })
-
- it("must not change the given object", function() {
- var obj = {name: "John"}
- O.eachOwn(obj, noop)
- obj.must.eql({name: "John"})
- })
-})
-
-function noop() {}
diff --git a/oolong/test/oolong/each_test.js b/oolong/test/oolong/each_test.js
deleted file mode 100644
index b74fce6..0000000
--- a/oolong/test/oolong/each_test.js
+++ /dev/null
@@ -1,56 +0,0 @@
-var O = require("../..")
-var Sinon = require("sinon")
-
-describe("Oolong.each", function() {
- it("must call function with value, key and object", function() {
- var obj = {name: "John", age: 42, height: 190}
- var spy = Sinon.spy()
- var context = {}
- O.each(obj, spy, context)
-
- spy.callCount.must.equal(3)
- spy.args[0][0].must.equal("John")
- spy.args[0][1].must.equal("name")
- spy.args[0][2].must.equal(obj)
- spy.thisValues[0].must.equal(context)
- spy.args[1][0].must.equal(42)
- spy.args[1][1].must.equal("age")
- spy.args[1][2].must.equal(obj)
- spy.thisValues[1].must.equal(context)
- spy.args[2][0].must.equal(190)
- spy.args[2][1].must.equal("height")
- spy.args[2][2].must.equal(obj)
- spy.thisValues[2].must.equal(context)
- })
-
- it("must call function for inherited properties", function() {
- var obj = Object.create({name: "John"})
- obj.age = 42
- var spy = Sinon.spy()
- var context = {}
- O.each(obj, spy, context)
-
- spy.callCount.must.equal(2)
- spy.args[0][0].must.equal(42)
- spy.args[0][1].must.equal("age")
- spy.args[0][2].must.equal(obj)
- spy.thisValues[0].must.equal(context)
- spy.args[1][0].must.equal("John")
- spy.args[1][1].must.equal("name")
- spy.args[1][2].must.equal(obj)
- spy.thisValues[0].must.equal(context)
- })
-
- it("must return the given object", function() {
- var obj = {}
- O.each(obj, noop).must.equal(obj)
- })
-
- it("must not change the given object", function() {
- var obj = {name: "John"}
- O.each(obj, noop)
- obj.must.eql({name: "John"})
- })
-})
-
-function noop() {}
diff --git a/oolong/test/oolong/filter_test.js b/oolong/test/oolong/filter_test.js
deleted file mode 100644
index df9eeab..0000000
--- a/oolong/test/oolong/filter_test.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var O = require("../..")
-var Sinon = require("sinon")
-
-describe("Oolong.filter", function() {
- function isEven(value) { return value % 2 == 0 }
-
- it("must filter properties", function() {
- O.filter({a: 1, b: 2, c: 3, d: 4}, isEven).must.eql({b: 2, d: 4})
- })
-
- it("must filter inherited properties", function() {
- var obj = Object.create({a: 1, b: 2, c: 3, d: 4})
- O.filter(obj, isEven).must.eql({b: 2, d: 4})
- })
-
- it("must call function with value, key and object", function() {
- var obj = {name: "John"}
- var spy = Sinon.spy()
- var context = {}
- O.filter(obj, spy, context)
-
- spy.callCount.must.equal(1)
- spy.firstCall.args[0].must.equal("John")
- spy.firstCall.args[1].must.equal("name")
- spy.firstCall.args[2].must.equal(obj)
- spy.firstCall.thisValue.must.equal(context)
- })
-
- it("must not change the given object", function() {
- var obj = {name: "John"}
- O.filter(obj, function() { return false }).must.not.equal(obj)
- obj.must.eql({name: "John"})
- })
-})
diff --git a/oolong/test/oolong/for_each_own_test.js b/oolong/test/oolong/for_each_own_test.js
deleted file mode 100644
index 3ec486b..0000000
--- a/oolong/test/oolong/for_each_own_test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.forEachOwn", function() {
- it("must be an alias to .eachOwn", function() {
- O.forEachOwn.must.equal(O.eachOwn)
- })
-})
diff --git a/oolong/test/oolong/for_each_test.js b/oolong/test/oolong/for_each_test.js
deleted file mode 100644
index f3b393e..0000000
--- a/oolong/test/oolong/for_each_test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.forEach", function() {
- it("must be an alias to .each", function() {
- O.forEach.must.equal(O.each)
- })
-})
diff --git a/oolong/test/oolong/has_own_test.js b/oolong/test/oolong/has_own_test.js
deleted file mode 100644
index 9fa492b..0000000
--- a/oolong/test/oolong/has_own_test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.hasOwn", function() {
- it("must return false given an object without property", function() {
- O.hasOwn({}, "name").must.be.false()
- })
-
- it("must return true given an object with property", function() {
- O.hasOwn({"name": "John"}, "name").must.be.true()
- })
-
- it("must return true given a property set undefined", function() {
- O.hasOwn({"name": undefined}, "name").must.be.true()
- })
-
- it("must return false given an object with an inherited property",
- function() {
- O.hasOwn(Object.create({name: "John"}), "name").must.be.false()
- })
-})
diff --git a/oolong/test/oolong/has_test.js b/oolong/test/oolong/has_test.js
deleted file mode 100644
index eadcc3e..0000000
--- a/oolong/test/oolong/has_test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.has", function() {
- it("must return false given an object without property", function() {
- O.has({}, "name").must.be.false()
- })
-
- it("must return true given an object with property", function() {
- O.has({"name": "John"}, "name").must.be.true()
- })
-
- it("must return true given a property set undefined", function() {
- O.has({"name": undefined}, "name").must.be.true()
- })
-
- it("must return true given an object with an inherited property",
- function() {
- O.has(Object.create({name: "John"}), "name").must.be.true()
- })
-})
diff --git a/oolong/test/oolong/is_empty_test.js b/oolong/test/oolong/is_empty_test.js
deleted file mode 100644
index 204baae..0000000
--- a/oolong/test/oolong/is_empty_test.js
+++ /dev/null
@@ -1,16 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.isEmpty", function() {
- it("must return true given an empty object", function() {
- O.isEmpty({}).must.be.true()
- })
-
- it("must return false given an non-empty object", function() {
- O.isEmpty({name: "John"}).must.be.false()
- })
-
- it("must return false given an object with an inherited property",
- function() {
- O.isEmpty(Object.create({name: "John"})).must.be.false()
- })
-})
diff --git a/oolong/test/oolong/is_in_own_test.js b/oolong/test/oolong/is_in_own_test.js
deleted file mode 100644
index e977376..0000000
--- a/oolong/test/oolong/is_in_own_test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.isInOwn", function() {
- it("must be an alias to .hasOwn", function() {
- O.isInOwn.must.equal(O.hasOwn)
- })
-})
diff --git a/oolong/test/oolong/is_in_test.js b/oolong/test/oolong/is_in_test.js
deleted file mode 100644
index 3918b11..0000000
--- a/oolong/test/oolong/is_in_test.js
+++ /dev/null
@@ -1,7 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.isIn", function() {
- it("must be an alias to .has", function() {
- O.isIn.must.equal(O.has)
- })
-})
diff --git a/oolong/test/oolong/is_object_test.js b/oolong/test/oolong/is_object_test.js
deleted file mode 100644
index 7b65bb2..0000000
--- a/oolong/test/oolong/is_object_test.js
+++ /dev/null
@@ -1,72 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.isObject", function() {
- it("must return true given an object literal", function() {
- O.isObject({}).must.be.true()
- })
-
- it("must return true given an object inheriting from a literal",
- function() {
- O.isObject(Object.create({})).must.be.true()
- })
-
- it("must return true given Object.prototype", function() {
- O.isObject(Object.prototype).must.be.true()
- })
-
- it("must return true given an Object inheritng from null", function() {
- O.isObject(Object.create(null)).must.be.true()
- })
-
- it("must return true given Math", function() {
- O.isObject(Math).must.be.true()
- })
-
- it("must return true given JSON", function() {
- O.isObject(JSON).must.be.true()
- })
-
- // Arguments have all the qualities of an object, so it might as well be one.
- it("must return true given arguments", function() {
- O.isObject(arguments).must.be.true()
- })
-
- it("must return false given undefined", function() {
- O.isObject(undefined).must.be.false()
- })
-
- it("must return false given null", function() {
- O.isObject(null).must.be.false()
- })
-
- it("must return false given a number", function() {
- O.isObject(1).must.be.false()
- })
-
- it("must return false given a string", function() {
- O.isObject("").must.be.false()
- })
-
- it("must return true given an array", function() {
- O.isObject([]).must.be.true()
- })
-
- it("must return false given a function", function() {
- O.isObject(noop).must.be.false()
- })
-
- it("must return true given a regular expression", function() {
- O.isObject(/./).must.be.true()
- })
-
- it("must return true given an instance of Date", function() {
- O.isObject(new Date).must.be.true()
- })
-
- it("must return true given an instance of a class", function() {
- function Model() {}
- O.isObject(new Model).must.be.true()
- })
-})
-
-function noop() {}
diff --git a/oolong/test/oolong/is_own_empty_test.js b/oolong/test/oolong/is_own_empty_test.js
deleted file mode 100644
index 980139d..0000000
--- a/oolong/test/oolong/is_own_empty_test.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.isOwnEmpty", function() {
- it("must return true given an empty object", function() {
- O.isOwnEmpty({}).must.be.true()
- })
-
- it("must return false given an non-empty object", function() {
- O.isOwnEmpty({name: "John"}).must.be.false()
- })
-
- it("must return false given an object with hasOwnProperty", function() {
- O.isOwnEmpty({hasOwnProperty: 42}).must.be.false()
- })
-
- it("must return true given an object with an inherited property",
- function() {
- O.isOwnEmpty(Object.create({name: "John"})).must.be.true()
- })
-})
diff --git a/oolong/test/oolong/is_plain_object_test.js b/oolong/test/oolong/is_plain_object_test.js
deleted file mode 100644
index d712366..0000000
--- a/oolong/test/oolong/is_plain_object_test.js
+++ /dev/null
@@ -1,83 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.isPlainObject", function() {
- it("must return true given an object literal", function() {
- O.isPlainObject({}).must.be.true()
- })
-
- it("must return true given an object inheriting from a literal",
- function() {
- O.isPlainObject(Object.create({})).must.be.true()
- })
-
- it("must return true given Object.prototype", function() {
- O.isPlainObject(Object.prototype).must.be.true()
- })
-
- it("must return true given an Object inheritng from null", function() {
- O.isPlainObject(Object.create(null)).must.be.true()
- })
-
- it("must return true given Math", function() {
- O.isPlainObject(Math).must.be.true()
- })
-
- it("must return true given JSON", function() {
- O.isPlainObject(JSON).must.be.true()
- })
-
- // Arguments have all the qualities of a plain object, so it might as well
- // be one.
- it("must return true given arguments", function() {
- O.isPlainObject(arguments).must.be.true()
- })
-
- it("must return false given undefined", function() {
- O.isPlainObject(undefined).must.be.false()
- })
-
- it("must return false given null", function() {
- O.isPlainObject(null).must.be.false()
- })
-
- it("must return false given a number", function() {
- O.isPlainObject(1).must.be.false()
- })
-
- it("must return true given a string", function() {
- O.isPlainObject("").must.be.false()
- })
-
- it("must return false given an array", function() {
- O.isPlainObject([]).must.be.false()
- })
-
- it("must return false given Array.prototype", function() {
- O.isPlainObject(Array.prototype).must.be.false()
- })
-
- it("must return false given a function", function() {
- O.isPlainObject(noop).must.be.false()
- })
-
- it("must return false given a regular expression", function() {
- O.isPlainObject(/./).must.be.false()
- })
-
- it("must return false given an instance of Date", function() {
- O.isPlainObject(new Date).must.be.false()
- })
-
- it("must return false given an instance of a class", function() {
- function Model() {}
- O.isPlainObject(new Model).must.be.false()
- })
-
- it("must return false given an object inheriting from an instance",
- function() {
- function Model() {}
- O.isPlainObject(Object.create(new Model)).must.be.false()
- })
-})
-
-function noop() {}
diff --git a/oolong/test/oolong/keys_test.js b/oolong/test/oolong/keys_test.js
deleted file mode 100644
index 71ed4a1..0000000
--- a/oolong/test/oolong/keys_test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.keys", function() {
- it("must return all enumerable keys of an object", function() {
- O.keys({a: 1, b: 2}).must.eql(["a", "b"])
- })
-
- it("must return inherited enumerable keys of an object", function() {
- O.keys(Object.create({a: 1, b: 2})).must.eql(["a", "b"])
- })
-})
diff --git a/oolong/test/oolong/lookup_getter_test.js b/oolong/test/oolong/lookup_getter_test.js
deleted file mode 100644
index cfae4c6..0000000
--- a/oolong/test/oolong/lookup_getter_test.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.lookupGetter", function() {
- it("must lookup a getter", function() {
- var obj = Object.defineProperty({}, "name", {get: getter})
- O.lookupGetter(obj, "name").must.equal(getter)
- })
-
- it("must lookup a getter of an inherited property", function() {
- var obj = Object.defineProperty({}, "name", {get: getter})
- O.lookupGetter(Object.create(obj), "name").must.equal(getter)
- })
-
- it("must return undefined given no getter", function() {
- demand(O.lookupGetter({}, "name")).be.undefined()
- })
-
- it("must not lookup setter", function() {
- var obj = Object.defineProperty({}, "name", {set: setter})
- demand(O.lookupGetter(obj, "name")).be.undefined()
- })
-
- // NOTE: This test was broken in V8 versions between 3.28.73 (Node v0.12.2)
- // and 3.28.71.19 (Node v0.12.7). Not sure if it's intentional.
- // https://code.google.com/p/v8/issues/detail?id=4321
- xit("must return undefined given an own property with value", function() {
- var obj = Object.defineProperty({}, "name", {get: getter})
- var child = Object.create(obj, {name: {value: "John", configurable: true}})
- child.name.must.equal("John")
- demand(O.lookupGetter(child, "name")).be.undefined()
- })
-})
-
-function setter() {}
-function getter() {}
diff --git a/oolong/test/oolong/lookup_setter_test.js b/oolong/test/oolong/lookup_setter_test.js
deleted file mode 100644
index 49939a0..0000000
--- a/oolong/test/oolong/lookup_setter_test.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.lookupSetter", function() {
- it("must lookup a setter", function() {
- var obj = Object.defineProperty({}, "name", {set: setter})
- O.lookupSetter(obj, "name").must.equal(setter)
- })
-
- it("must lookup a setter of an inherited property", function() {
- var obj = Object.defineProperty({}, "name", {set: setter})
- O.lookupSetter(Object.create(obj), "name").must.equal(setter)
- })
-
- it("must return undefined given no setter", function() {
- demand(O.lookupSetter({}, "name")).be.undefined()
- })
-
- it("must not lookup getter", function() {
- var obj = Object.defineProperty({}, "name", {get: getter})
- demand(O.lookupSetter(obj, "name")).be.undefined()
- })
-
- // NOTE: This test was broken in V8 versions between 3.28.73 (Node v0.12.2)
- // and 3.28.71.19 (Node v0.12.7). Not sure if it's intentional.
- // https://code.google.com/p/v8/issues/detail?id=4321
- xit("must return undefined given an own property with value", function() {
- var obj = Object.defineProperty({}, "name", {set: setter})
- var child = Object.create(obj, {name: {value: "John", configurable: true}})
- child.name.must.equal("John")
- demand(O.lookupSetter(child, "name")).be.undefined()
- })
-})
-
-function setter() {}
-function getter() {}
diff --git a/oolong/test/oolong/map_keys_test.js b/oolong/test/oolong/map_keys_test.js
deleted file mode 100644
index 23ec2e7..0000000
--- a/oolong/test/oolong/map_keys_test.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var O = require("../..")
-var Sinon = require("sinon")
-var toUpperCase = Function.call.bind(String.prototype.toUpperCase)
-
-describe("Oolong.mapKeys", function() {
- it("must transform keys", function() {
- var obj = O.mapKeys({name: "John", age: 32}, toUpperCase)
- obj.must.eql({NAME: "John", AGE: 32})
- })
-
- it("must transform keys of inherited properties", function() {
- var obj = O.mapKeys(Object.create({name: "John", age: 32}), toUpperCase)
- obj.must.eql({NAME: "John", AGE: 32})
- })
-
- it("must call function with key, value and object", function() {
- var obj = {name: "John"}
- var spy = Sinon.spy()
- var context = {}
- O.mapKeys(obj, spy, context)
-
- spy.callCount.must.equal(1)
- spy.firstCall.args[0].must.equal("name")
- spy.firstCall.args[1].must.equal("John")
- spy.firstCall.args[2].must.equal(obj)
- spy.firstCall.thisValue.must.equal(context)
- })
-
- it("must not change the given object", function() {
- var obj = {name: "John"}
- O.mapKeys(obj, function() { return "NAME" }).must.not.equal(obj)
- obj.must.eql({name: "John"})
- })
-})
diff --git a/oolong/test/oolong/map_test.js b/oolong/test/oolong/map_test.js
deleted file mode 100644
index 59286f9..0000000
--- a/oolong/test/oolong/map_test.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var O = require("../..")
-var Sinon = require("sinon")
-
-describe("Oolong.map", function() {
- function double(value) { return value * 2 }
-
- it("must map properties", function() {
- O.map({a: 1, b: 2, c: 3}, double).must.eql({a: 2, b: 4, c: 6})
- })
-
- it("must map inherited properties", function() {
- var obj = Object.create({a: 1, b: 2, c: 3})
- O.map(obj, double).must.eql({a: 2, b: 4, c: 6})
- })
-
- it("must call function with value, key and object", function() {
- var obj = {name: "John"}
- var spy = Sinon.spy()
- var context = {}
- O.map(obj, spy, context)
-
- spy.callCount.must.equal(1)
- spy.firstCall.args[0].must.equal("John")
- spy.firstCall.args[1].must.equal("name")
- spy.firstCall.args[2].must.equal(obj)
- spy.firstCall.thisValue.must.equal(context)
- })
-
- it("must not change the given object", function() {
- var obj = {answer: 42}
- O.map(obj, double).must.not.equal(obj)
- obj.must.eql({answer: 42})
- })
-})
diff --git a/oolong/test/oolong/merge_test.js b/oolong/test/oolong/merge_test.js
deleted file mode 100644
index b47c2a7..0000000
--- a/oolong/test/oolong/merge_test.js
+++ /dev/null
@@ -1,93 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.merge", function() {
- it("must return undefined given nothing", function() {
- demand(O.merge()).be.undefined()
- })
-
- it("must return null given null", function() {
- demand(O.merge(null)).be.null()
- })
-
- it("must return undefined given undefined and a source", function() {
- demand(O.merge(undefined, {name: "John"})).be.undefined()
- })
-
- it("must return null given null and a source", function() {
- demand(O.merge(null, {name: "John"})).be.null()
- })
-
- it("must return target given no source", function() {
- var obj = {}
- O.merge(obj).must.equal(obj)
- })
-
- it("must return target given one source", function() {
- var obj = {}
- O.merge(obj, {name: "John"}).must.equal(obj)
- })
-
- it("must merge 2 plain objects", function() {
- var target = {name: "John"}
- O.merge(target, {age: 42}).must.eql({name: "John", age: 42})
- })
-
- it("must merge 3 plain objects", function() {
- var obj = O.merge({name: "John"}, {age: 42}, {height: 190})
- obj.must.eql({name: "John", age: 42, height: 190})
- })
-
- it("must merge two plain objects deeply", function() {
- var target = {name: "John", attributes: {age: 13}}
- var source = {attributes: {height: 190}}
- var obj = O.merge(target, source)
- obj.must.eql({name: "John", attributes: {age: 13, height: 190}})
- })
-
- it("must replace first object if second not an object", function() {
- var target = {attributes: {age: 13}}
- var source = {attributes: null}
- O.merge(target, source).must.eql({attributes: null})
- })
-
- it("must replace second object if first not an object", function() {
- var target = {attributes: null}
- var source = {attributes: {age: 13}}
- O.merge(target, source).must.eql({attributes: {age: 13}})
- })
-
- it("must not modify second sources objects", function() {
- var a = {attributes: {age: 13}}
- var b = {attributes: {height: 190}}
- O.merge({}, a, b)
- a.must.eql({attributes: {age: 13}})
- })
-
- it("must not modify deep second sources objects", function() {
- var a = {john: {attributes: {age: 13}}}
- var b = {john: {attributes: {height: 190}}}
- O.merge({}, a, b)
- a.must.eql({john: {attributes: {age: 13}}})
- })
-
- it("must assign non-plain objects directly", function() {
- var date = new Date
- var obj = O.merge({name: "John"}, {date: date})
- obj.date.must.equal(date)
- })
-
- it("must merge inherited properties", function() {
- var obj = O.merge({name: "John"}, Object.create({age: 42}))
- obj.must.eql({name: "John", age: 42})
- })
-
- it("must not assign unenumerable properties", function() {
- var source = Object.defineProperty({}, "name", {value: "John"})
- O.merge({}, source).must.eql({})
- })
-
- it("must assign properties with undefined value", function() {
- O.merge({name: "John"}, {name: undefined}).must.eql({name: undefined})
- })
-})
diff --git a/oolong/test/oolong/object_test.js b/oolong/test/oolong/object_test.js
deleted file mode 100644
index ac90a31..0000000
--- a/oolong/test/oolong/object_test.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var O = require("../..")
-var Sinon = require("sinon")
-
-describe("Oolong.object", function() {
- function lengthOf(value) { return value.length }
-
- it("must create object", function() {
- var obj = O.object(["Alice", "Bob", "Charlie"], lengthOf)
- obj.must.eql({Alice: 5, Bob: 3, Charlie: 7})
- })
-
- it("must call function with value, index and keys", function() {
- var keys = ["Alice"]
- var spy = Sinon.spy()
- var context = {}
- O.object(keys, spy, context)
-
- spy.callCount.must.equal(1)
- spy.firstCall.args[0].must.equal("Alice")
- spy.firstCall.args[1].must.equal(0)
- spy.firstCall.args[2].must.equal(keys)
- spy.firstCall.thisValue.must.equal(context)
- })
-
- it("must not change the given object", function() {
- var obj = ["Alice", "Bob", "Charlie"]
- O.object(obj, lengthOf).must.not.equal(obj)
- obj.must.eql(["Alice", "Bob", "Charlie"])
- })
-})
diff --git a/oolong/test/oolong/own_keys_test.js b/oolong/test/oolong/own_keys_test.js
deleted file mode 100644
index 10fb72f..0000000
--- a/oolong/test/oolong/own_keys_test.js
+++ /dev/null
@@ -1,13 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.ownKeys", function() {
- it("must return all enumerable keys of an object", function() {
- O.ownKeys({a: 1, b: 2}).must.eql(["a", "b"])
- })
-
- it("must not return inherited enumerable keys of an object", function() {
- var obj = Object.create({a: 1})
- obj.b = 2
- O.ownKeys(obj).must.eql(["b"])
- })
-})
diff --git a/oolong/test/oolong/pick_deep_test.js b/oolong/test/oolong/pick_deep_test.js
deleted file mode 100644
index fa5feb7..0000000
--- a/oolong/test/oolong/pick_deep_test.js
+++ /dev/null
@@ -1,70 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.pickDeep", function() {
- it("must return a new object with given key", function() {
- var obj = O.pickDeep({name: "Alice", age: 42, height: 100}, "name")
- obj.must.eql({name: "Alice"})
- })
-
- it("must return a new object with given 2nd level key", function() {
- var person = {name: "Alice", address: {country: "UK", street: "Downing"}}
- var obj = O.pickDeep(person, "name", ["address", "country"])
- obj.must.eql({name: "Alice", address: {country: "UK"}})
- })
-
- it("must return a new object with given 3rd level key", function() {
- var children = {Bob: {name: "Bob", age: "13"}}
- var person = {name: "Alice", children: children}
- var obj = O.pickDeep(person, "name", ["children", "Bob", "name"])
- obj.must.eql({name: "Alice", children: {Bob: {name: "Bob"}}})
- })
-
- it("must return a new object with given keys", function() {
- var obj = O.pickDeep({name: "Alice", age: 42, height: 100}, "name", "age")
- obj.must.eql({name: "Alice", age: 42})
- })
-
- it("must return a new object with given 2nd level keys", function() {
- var address = {country: "UK", street: "Downing", apartment: 10}
- var person = {name: "Alice", address: address}
- var obj = O.pickDeep(person,
- "name",
- ["address", "country"],
- ["address", "street"])
- obj.must.eql({name: "Alice", address: {country: "UK", street: "Downing"}})
- })
-
- it("must return an empty object given no keys", function() {
- O.pickDeep({name: "Alice", age: 42}).must.eql({})
- })
-
- it("must return property even if properties inherited", function() {
- var person = Object.create({name: "Alice", height: 100})
- person.age = 42
- O.pickDeep(person, "name", "age").must.eql({name: "Alice", age: 42})
- })
-
- it("must not change the given object", function() {
- var obj = {name: "Alice", age: 42}
- O.pickDeep(obj, "name").must.not.equal(obj)
- obj.must.eql({name: "Alice", age: 42})
- })
-
- it("must not return non-existent keys", function() {
- var obj = O.pickDeep({name: "Alice", age: 42}, "name", "height")
- obj.must.eql({name: "Alice"})
- })
-
- it("must not return non-existent 2nd level keys", function() {
- var person = {name: "Alice", address: {country: "UK", street: "Downing"}}
- var obj = O.pickDeep(person, "name", ["address", "apartment"])
- obj.must.eql({name: "Alice"})
- })
-
- it("must not return non-existent 3rd level keys", function() {
- var children = {Bob: {name: "Bob", age: "13"}}
- var person = {name: "Alice", children: children}
- var obj = O.pickDeep(person, "name", ["children", "Bob", "height"])
- obj.must.eql({name: "Alice"})
- })
-})
diff --git a/oolong/test/oolong/pick_test.js b/oolong/test/oolong/pick_test.js
deleted file mode 100644
index b59b883..0000000
--- a/oolong/test/oolong/pick_test.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.pick", function() {
- it("must return a new object with given key", function() {
- var obj = O.pick({name: "Alice", age: 42, height: 100}, "name")
- obj.must.eql({name: "Alice"})
- })
-
- it("must return a new object with given keys", function() {
- var obj = O.pick({name: "Alice", age: 42, height: 100}, "name", "age")
- obj.must.eql({name: "Alice", age: 42})
- })
-
- it("must return an empty object given no keys", function() {
- O.pick({name: "Alice", age: 42}).must.eql({})
- })
-
- it("must return property even if properties inherited", function() {
- var person = Object.create({name: "Alice", height: 100})
- person.age = 42
- O.pick(person, "name", "age").must.eql({name: "Alice", age: 42})
- })
-
- it("must not change the given object", function() {
- var obj = {name: "Alice", age: 42}
- O.pick(obj, "name").must.not.equal(obj)
- obj.must.eql({name: "Alice", age: 42})
- })
-
- it("must not return non-existent keys", function() {
- var obj = O.pick({name: "Alice", age: 42}, "name", "height")
- obj.must.eql({name: "Alice"})
- })
-})
diff --git a/oolong/test/oolong/pluck_test.js b/oolong/test/oolong/pluck_test.js
deleted file mode 100644
index 10c4508..0000000
--- a/oolong/test/oolong/pluck_test.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.pluck", function() {
- it("must return a new object with given property as value", function() {
- var people = O.pluck({
- a: {name: "Alice"},
- b: {name: "Bob"},
- c: {name: "Charlie"}
- }, "name")
-
- people.must.eql({a: "Alice", b: "Bob", c: "Charlie"})
- })
-
- it("must return property even if both object and its child inherited",
- function() {
- var people = O.pluck(Object.create({
- a: Object.create({name: "Alice"}),
- b: Object.create({name: "Bob"}),
- c: Object.create({name: "Charlie"})
- }), "name")
-
- people.must.eql({a: "Alice", b: "Bob", c: "Charlie"})
- })
-
- it("must not change the given object", function() {
- var obj = {a: "Alice"}
- O.pluck(obj, "name").must.not.equal(obj)
- obj.must.eql({a: "Alice"})
- })
-
- it("must return undefined for values given a non-existent property",
- function() {
- var people = O.pluck({a: {}, b: {}, c: {}}, "name")
- people.must.eql({a: undefined, b: undefined, c: undefined})
- })
-})
diff --git a/oolong/test/oolong/property_test.js b/oolong/test/oolong/property_test.js
deleted file mode 100644
index 707b217..0000000
--- a/oolong/test/oolong/property_test.js
+++ /dev/null
@@ -1,18 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.property", function() {
- it("must return a function that returns the given property", function() {
- var obj = {name: "John"}
- O.property("name")(obj).must.equal("John")
- })
-
- it("must return inherited properties", function() {
- var obj = Object.create({name: "John"})
- O.property("name")(obj).must.equal("John")
- })
-
- it("must return undefined given a non-existent property", function() {
- demand(O.property("name")({})).be.undefined()
- })
-})
diff --git a/oolong/test/oolong/reject_test.js b/oolong/test/oolong/reject_test.js
deleted file mode 100644
index 2568d26..0000000
--- a/oolong/test/oolong/reject_test.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var O = require("../..")
-var Sinon = require("sinon")
-
-describe("Oolong.reject", function() {
- function isEven(value) { return value % 2 == 0 }
-
- it("must reject properties", function() {
- O.reject({a: 1, b: 2, c: 3, d: 4}, isEven).must.eql({a: 1, c: 3})
- })
-
- it("must reject inherited properties", function() {
- var obj = Object.create({a: 1, b: 2, c: 3, d: 4})
- O.reject(obj, isEven).must.eql({a: 1, c: 3})
- })
-
- it("must call function with value, key and object", function() {
- var obj = {name: "John"}
- var spy = Sinon.spy()
- var context = {}
- O.reject(obj, spy, context)
-
- spy.callCount.must.equal(1)
- spy.firstCall.args[0].must.equal("John")
- spy.firstCall.args[1].must.equal("name")
- spy.firstCall.args[2].must.equal(obj)
- spy.firstCall.thisValue.must.equal(context)
- })
-
- it("must not change the given object", function() {
- var obj = {name: "John"}
- O.reject(obj, function() { return true }).must.not.equal(obj)
- obj.must.eql({name: "John"})
- })
-})
diff --git a/oolong/test/oolong/set_prototype_of_test.js b/oolong/test/oolong/set_prototype_of_test.js
deleted file mode 100644
index c93a596..0000000
--- a/oolong/test/oolong/set_prototype_of_test.js
+++ /dev/null
@@ -1,49 +0,0 @@
-var O = require("../..")
-var demand = require("must")
-
-describe("Oolong.setPrototypeOf", function() {
- it("must return object", function() {
- var obj = {}
- O.setPrototypeOf(obj, {}).must.equal(obj)
- })
-
- it("must set object's prototype given object prototype", function() {
- var obj = {}
- var prototype = {}
- O.setPrototypeOf(obj, prototype)
- Object.getPrototypeOf(obj).must.equal(prototype)
- })
-
- it("must set object's prototype given null prototype", function() {
- var obj = {}
- O.setPrototypeOf(obj, null)
- demand(Object.getPrototypeOf(obj)).be.null()
- })
-
- it("must throw given undefined", function() {
- O.setPrototypeOf.bind(null, undefined, {}).must.throw(TypeError)
- })
-
- it("must throw given null", function() {
- O.setPrototypeOf.bind(null, null, {}).must.throw(TypeError)
- })
-
- it("must ignore if given a number primitive", function() {
- O.setPrototypeOf(42, {}).must.equal(42)
- })
-
- it("must throw given a non-extensible object", function() {
- var obj = Object.preventExtensions({})
- O.setPrototypeOf.bind(null, obj, {}).must.throw(TypeError)
- })
-
- it("must throw given a sealed object", function() {
- var obj = Object.seal({})
- O.setPrototypeOf.bind(null, obj, {}).must.throw(TypeError)
- })
-
- it("must throw given a frozen object", function() {
- var obj = Object.freeze({})
- O.setPrototypeOf.bind(null, obj, {}).must.throw(TypeError)
- })
-})
diff --git a/oolong/test/oolong/values_test.js b/oolong/test/oolong/values_test.js
deleted file mode 100644
index 6b76d25..0000000
--- a/oolong/test/oolong/values_test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.values", function() {
- it("must return all enumerable values of an object", function() {
- O.values({a: 1, b: 2}).must.eql([1, 2])
- })
-
- it("must return inherited enumerable values of an object", function() {
- O.values(Object.create({a: 1, b: 2})).must.eql([1, 2])
- })
-})
diff --git a/oolong/test/oolong/wrap_test.js b/oolong/test/oolong/wrap_test.js
deleted file mode 100644
index 739e15b..0000000
--- a/oolong/test/oolong/wrap_test.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var O = require("../..")
-
-describe("Oolong.wrap", function() {
- it("must wrap given value with string", function() {
- O.wrap(42, "answer").must.eql({answer: 42})
- })
-
- if (typeof Symbol != "undefined")
- it("must wrap given value with symbol ", function() {
- var symbol = Symbol()
- var obj = O.wrap(42, symbol)
- obj.must.eql({})
- obj[symbol].must.equal(42)
- })
-})
diff --git a/package.json b/package.json
index 8e17b12..4ab27ed 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
},
"main": "stringify.js",
"scripts": {
- "test": "node test.js"
+ "test": "make test"
},
"devDependencies": {
"mocha": ">= 2.1.0 < 3",
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in first set of .debs but not in second
-rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/egal/index.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/egal/package.json -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/kindof/kindof.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/kindof/package.json -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/lib/assertion_error.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/lib/es6.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/lib/index.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/lib/rejectable.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/lib/resolvable.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/lib/thenable.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/must.d.ts -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/must.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/package.json -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/must/register.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/oolong/index.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/oolong/lib/es6.js -rw-r--r-- root/root /usr/share/nodejs/json-stringify-safe/node_modules/oolong/package.json
No differences were encountered in the control files