summaryrefslogtreecommitdiff
path: root/lib/assert.js
Commit message (Collapse)AuthorAgeFilesLines
* repl: Private Buffer object in lib/* filesEmmanuel Odeke2014-10-251-1/+2
| | | | | | | | | | | Fixes usage of global object 'Buffer' in lib/* files by ensuring that each file does an explicit require('buffer').Buffer. Previously, when running a repl, due to usage of global 'Buffer', any redefinition of Buffer would cause a crash eg var Buffer = {}. Fixes: https://github.com/joyent/node/issues/8588 PR-URL: https://github.com/joyent/node/pull/8603 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* lib: remove and restructure calls to isNaN()cjihrig2014-07-101-1/+1
| | | | | | | | | | Switch condition order to check for null before calling isNaN(). Also remove two unnecessary calls to isNaN() that are already covered by calls to isFinite(). This commit targets v0.10, as opposed to #7891, which targets master (suggested by @bnoordhuis). Closes #7840. Signed-off-by: Fedor Indutny <fedor@indutny.com>
* assert: Ensure reflexivity of deepEqualMike Pennisi2014-02-251-4/+5
| | | | | | Ensure that the behavior of `assert.deepEqual` does not depend on argument ordering when comparing an `arguments` object with a non-`arguments` object.
* lintisaacs2013-05-141-1/+1
|
* assert: put info in err.message, not err.nameRyan Doenges2013-04-181-12/+6
| | | | | | | | | | | | | | | | 4716dc6 made assert.equal() and related functions work better by generating a better toString() from the expected, actual, and operator values passed to fail(). Unfortunately, this was accomplished by putting the generated message into the error's `name` property. When you passed in a custom error message, the error would put the custom error into `name` *and* `message`, resulting in helpful string representations like "AssertionError: Oh no: Oh no". This commit resolves that issue by storing the generated message in the `message` property while leaving the error's name alone and adding a regression test so that this doesn't pop back up later. Closes #5292.
* assert: Simplify AssertError creationisaacs2013-04-031-14/+10
|
* assert: improve support for new execution contextslukebayes2012-12-291-1/+1
| | | | More detailed information in GH-693
* doc: update assert.doesNotThrow() docsBen Noordhuis2012-08-291-1/+1
| | | | | | | | It takes an optional "expected exception" argument that is not used meaningfully but is nevertheless documented. Undocument it, it confuses casual readers of the documentation. Fixes #3935.
* assert: fix throws() throws an error without message propertykoichik2012-07-291-2/+2
| | | | Fixes #2893.
* assert: remove unnecessary use of __proto__Nathan Rajlich2012-07-251-4/+2
| | | | | | | AssertionError already inherits from Error above using util.inherits(), so this extra line was redundant. test/simple/test-assert.js already tests for `instanceof`, and still passes.
* docs: correct the description of assert.ok()Nao Iizuka2012-03-121-1/+1
|
* assert: test `RegExp`'s properties when checking for equalityMaciej Małecki2011-12-201-2/+7
| | | | | | Previous code ignored the fact that `/a/ != /a/g`. Test case included.
* assert: .deepEqual() support for RegExp objectsPedro Teixeira2011-12-201-2/+7
|
* Fixed a lot of jslint errors.Colton Baker2011-10-051-2/+2
| | | | Fixes #1831
* assert: Make `assert` module an `assert.ok` functionMaciej Małecki2011-10-021-2/+3
| | | | | | | | | | | | Code can be written: var assert = require('assert'); assert(true); instead of: var assert = require('assert'); assert.ok(true);
* Improve assert error messagesRyan Dahl2011-08-091-17/+28
| | | | | | 1. actual and expected should be displayed in the same order they were given 2. long values should be truncated.
* Improvements AssertionError messagekoichik2011-07-141-2/+14
| | | | Fixes #217.
* LintRyan Dahl2011-01-061-1/+1
|
* fix assert.throwsOleg Slobodskoi2010-12-211-5/+6
|
* lintRyan Dahl2010-12-011-41/+43
|
* assert.throws can now accept as RegExpOleg Slobodskoi2010-11-291-30/+33
| | | | makes validation of errors more flexible
* Soft migration of sys -> util, Removal of deprecated utils module.Micheil Smith2010-10-111-2/+2
|
* syntax fixes to pass jslintJoshaven Potter2010-10-061-2/+2
|
* Special deepEquals for bufferRyan Dahl2010-09-071-0/+9
|
* Add assert.ifErrorMikeal Rogers2010-05-211-0/+1
|
* trailing whitespace fixesisaacs2010-04-111-1/+1
|
* Include lib/ directory in node executable. Compile on demand.Ryan Dahl2010-03-151-3/+3
| | | | | | | | | | | | | | Instead of installing the files in /usr/lib/node/libraries and loading them from the file system, the files are built-in to the node executable. However, they are only compiled on demand. The reasoning is: 1. Allow for more complex internal javascript. In particular, process.stdout and process.stdin can be js implemented streams. 2. Ease system installs. Loading from disk each time is unnecessary overhead. Note that there is no "system" path for modules anymore. Only $HOME/.node_libraries.
* Move process.inherits to sysRyan Dahl2010-03-011-2/+2
|
* Make assert.AssertionError instance of ErrorRyan Dahl2010-01-241-0/+1
|
* Stack trace for asserts shouldn't include assert moduleRyan Dahl2009-12-291-24/+22
|
* Fix assert.js code styleRyan Dahl2009-12-291-155/+156
|
* Dependency free assert module with unit testsKarl Guertin2009-12-051-50/+160
|
* CommonJS testing for node.jsFelix Geisendörfer2009-12-051-0/+176
Refactored test suite to use the assert module for testing rather than mjsunit.