-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
34 lines (34 loc) · 3.18 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
"name": "assert",
"description": "commonjs assert - node.js api compatible",
"keywords": [
"assert"
],
"version": "1.3.0",
"homepage": "https://github.com/defunctzombie/commonjs-assert",
"repository": {
"type": "git",
"url": "git://github.com/defunctzombie/commonjs-assert.git"
},
"main": "./assert.js",
"dependencies": {
"util": "0.10.3"
},
"devDependencies": {
"zuul": "~1.10.2",
"mocha": "~1.21.4"
},
"license": "MIT",
"scripts": {
"test": "mocha --ui qunit test.js && zuul -- test.js"
},
"readme": "# assert\n\n[![Build Status](https://travis-ci.org/defunctzombie/commonjs-assert.svg?branch=master)](https://travis-ci.org/defunctzombie/commonjs-assert)\n\nThis module is used for writing unit tests for your applications, you can access it with require('assert').\n\nThe API is derived from the [commonjs 1.0 unit testing](http://wiki.commonjs.org/wiki/Unit_Testing/1.0) spec and the [node.js assert module](http://nodejs.org/api/assert.html)\n\n## assert.fail(actual, expected, message, operator)\nThrows an exception that displays the values for actual and expected separated by the provided operator.\n\n## assert(value, message), assert.ok(value, [message])\nTests if value is truthy, it is equivalent to assert.equal(true, !!value, message);\n\n## assert.equal(actual, expected, [message])\nTests shallow, coercive equality with the equal comparison operator ( == ).\n\n## assert.notEqual(actual, expected, [message])\nTests shallow, coercive non-equality with the not equal comparison operator ( != ).\n\n## assert.deepEqual(actual, expected, [message])\nTests for deep equality.\n\n## assert.notDeepEqual(actual, expected, [message])\nTests for any deep inequality.\n\n## assert.strictEqual(actual, expected, [message])\nTests strict equality, as determined by the strict equality operator ( === )\n\n## assert.notStrictEqual(actual, expected, [message])\nTests strict non-equality, as determined by the strict not equal operator ( !== )\n\n## assert.throws(block, [error], [message])\nExpects block to throw an error. error can be constructor, regexp or validation function.\n\nValidate instanceof using constructor:\n\n```javascript\nassert.throws(function() { throw new Error(\"Wrong value\"); }, Error);\n```\n\nValidate error message using RegExp:\n\n```javascript\nassert.throws(function() { throw new Error(\"Wrong value\"); }, /value/);\n```\n\nCustom error validation:\n\n```javascript\nassert.throws(function() {\n throw new Error(\"Wrong value\");\n}, function(err) {\n if ( (err instanceof Error) && /value/.test(err) ) {\n return true;\n }\n}, \"unexpected error\");\n```\n\n## assert.doesNotThrow(block, [message])\nExpects block not to throw an error, see assert.throws for details.\n\n## assert.ifError(value)\nTests if value is not a false value, throws if it is a true value. Useful when testing the first argument, error in callbacks.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/defunctzombie/commonjs-assert/issues"
},
"_id": "assert@1.3.0",
"_shasum": "03939a622582a812cc202320a0b9a56c9b815849",
"_from": "assert@>=1.3.0 <1.4.0",
"_resolved": "https://registry.npmjs.org/assert/-/assert-1.3.0.tgz"
}