0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

34 Commits

Author SHA1 Message Date
Minwoo Jung
de3e94b0ef doc: fix notDeepEqual API
API calls in `assert` are `deepEqual()`, not `notDeepEqual()`.
use `notDeepEqual` to make it clear.

PR-URL: https://github.com/nodejs/node/pull/4971
Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-01-31 16:49:52 +09:00
Timothy Gu
27c8b73fa6 doc: fix JSON generation for aliased methods
Currently assert/assert.ok currently has the following signature:

    "signatures": [
      {
        "params": [
          {
            "name": "value"
          },
          {
            "name": "message])"
          },
          {
            "name": "assert.ok(value"
          },
          {
            "name": "message",
            "optional": true
          }
        ]
      }
    ]

The heading reads

    assert(value[, message]), assert.ok(value[, message])

Split them into two sections to make it working.

PR-URL: https://github.com/nodejs/node/pull/4871
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2016-01-30 11:06:25 -08:00
Benjamin Gruenbaum
334a7e3614 doc: replace function expressions with arrows
This commit replaces multiple usages of `function(){}` with ES2015
arrow functions in places it was forgotten earlier. The goal is to
make the docs more consistent since other functions were already
replaced with ES2015 arrows.

In addition, it fixes invalid syntax in modules.markdown to valid
syntax as well as remove `var self = this` pattern usages in the code
where they are now possible to avoid through arrow functions.

PR-URL: https://github.com/nodejs/node/pull/4832
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-27 23:00:20 +01:00
Robert Jefe Lindstaedt
e436272897 doc: fenced all code blocks, typo fixes
This changes the code blocks from 4-space indentation to ``` fences for
better syntax highlighting and future linting support. Minor On-the-fly
changes for typos and highlight breaking markdown have been made.

JSON-Style objects have been changed so their closing bracket is
on the same line as the opening one.

Known issues:
* Not every JSON / object notation has been improved. Should
  make another run for this.
* Some example functions break hightlighting due to various
  combinations of brackets. However changing them means leaving
  the code style.

Fixes: https://github.com/nodejs/node/issues/4726
PR-URL: https://github.com/nodejs/node/pull/4733
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-01-21 20:55:09 +01:00
Wyatt Preul
d7c5110a79 doc: stronger suggestion for userland assert
Fixes: https://github.com/nodejs/node/issues/4532
PR-URL: https://github.com/nodejs/node/pull/4535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-01-11 10:17:31 -05:00
James M Snell
3e648eb2ca doc: improve assert.markdown copy
General improvements to assert.markdown copy including
new and improved examples

PR-URL: https://github.com/nodejs/node/pull/4360
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-12-28 12:14:49 -08:00
James M Snell
9b21119e17 doc: fix, modernize examples in docs
* Use single quotes consistently
* Modernize examples to use template strings and arrow funcs
* Fix a few typos
* Example edits for consistency

PR-URL: https://github.com/nodejs/node/pull/4282
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-12-17 08:07:29 -08:00
Rich Trott
70fb06a90b doc: clarify assert.fail doc
PR-URL: https://github.com/nodejs/node/pull/4186
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
2015-12-09 16:43:48 -08:00
jpersson
14b3aab7d2 doc: add links and backticks around names
* add backticks around names
* add single quotes around event names
* add parenthesis after function names
* add internal links between different sections
* add external links to MDN for some JavaScript references
* sort the link definitions alphabetically

PR-URL: https://github.com/nodejs/node/pull/4054
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-12-03 13:39:09 -08:00
Bryan English
cd1123a0fb doc: consistent reference-style links
Moved all the URLs in API docs to the bottom of the files as
reference-style links.

PR-URL: https://github.com/nodejs/node/pull/3845
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-16 07:36:59 -08:00
Tristian Flanagan
e16c669a65 doc: sort assert alphabetically
Reorders, with no contextual changes, the assert documentation
alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-12 17:38:34 -08:00
David Woods
471aa5a989 doc:fix function param order in assert doc
PR-URL: https://github.com/nodejs/node/pull/3533
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-11-03 13:13:07 -08:00
Rich Trott
f875c73325 doc: add information about Assert behavior and maintenance
Assert is now locked. Userland alternatives should be used. Assert is
for testing Node.js itself.

Document potentially surprising use of enumerable properties only in
deep equality assertions.

Ref: https://github.com/nodejs/node/pull/3124
Ref: https://github.com/nodejs/node/issues/3122

PR-URL: https://github.com/nodejs/node/pull/3330
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-10-19 11:49:22 -07:00
David Boivin
8e213096df doc: update the assert module summary
The current wording "This module is used for writing unit tests for your
applications, you can access it with require('assert')." implies that
this module should only be used in development while unit testing.

The article "Error Handling in Node.js" by Joyent
(https://www.joyent.com/developers/node/design/errors) uses the assert
module in an efficient way to validate required function arguments.

PR-URL: https://github.com/nodejs/node/pull/2799
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-10-11 19:24:39 +02:00
Fabio Oliveira
79ebeabd08 docs: Clarify assert.doesNotThrow behavior
The documentation for assert.doesNotThrow now reflects all the inputs
the function accepts, as well as the errors thrown for each combination
of parameter types.

PR-URL: https://github.com/nodejs/node/pull/2807
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-09-23 15:07:59 -07:00
Rich Trott
4fb4c14b61 doc: clarify description of assert.ifError()
This fixes a few typographical errors (comma splices and the like) and
clarifies the description of assert.ifError(). It also standardizes the
document on "inequality" rather than having both "inequality" and "non-
equality".

PR-URL: https://github.com/nodejs/node/pull/2941
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-18 23:46:36 -07:00
Rich Trott
8f87169805 doc: fix comma splice in Assertion Testing doc
This fixes a minor typographical error in the Assertion Testing doc.

PR-URL: https://github.com/nodejs/node/pull/2728
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-09-08 14:42:27 -07:00
Chris Dickinson
cf0306cd71 doc: update stability index
This simplifies the stability index to 4 levels:

0 - deprecated
1 - experimental / feature-flagged
2 - stable
3 - locked

Domains has been downgraded to deprecated, assert has been
downgraded to stable. Timers and Module remain locked. All
other APIs are now stable.

PR-URL: https://github.com/iojs/io.js/pull/943
Fixes: https://github.com/iojs/io.js/issues/930
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>
2015-02-27 14:23:01 -08:00
Andrei Sedoi
8c1df7a8a8 doc: use correct signature for assert()
The message argument is optional for both assert() and
assert.ok(). This commit makes message optional for assert().

PR-URL: https://github.com/joyent/node/pull/9003
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-02-13 13:37:24 -05:00
Vladimir Kurchatkin
3f473ef141 assert: introduce deepStrictEqual
`deepStrictEqual` works the same way as `strictEqual`, but
uses `===` to compare primitives and requires prototypes of
equal objects to be the same object.

Fixes: https://github.com/joyent/node/issues/7161
Fixes: https://github.com/iojs/io.js/issues/620
PR-URL: https://github.com/iojs/io.js/pull/639
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Rod Vagg <rod@vagg.org>
2015-02-09 14:14:20 +03:00
Trevor Norris
f2a78de6ec doc: fix optional parameter parsing
The parameter parser specifically looked for the old bracket syntax.
This generated a lot of warnings when building the docs. Those warnings
have been fixed by changing the parsing logic.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-09-29 16:32:34 -07:00
Trevor Norris
51b6b6844e doc: fix brackets for optional parameters
Documentation incorrectly used bracket notation for optional parameters.
This caused inconsistencies in usage because of examples like the
following:

    fs.write(fd, data[, position[, encoding]], callback)

This simply fixes all uses of bracket notation in documentation.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-09-25 11:26:15 -07:00
Nicolas Talle
1efe6837b2 doc: update assert.markdown
Update assert.throws() and assert.doesNotThrow() docs
2014-02-23 18:09:26 +04:00
Ben Noordhuis
e4cef1a083 doc: update assert.doesNotThrow() docs
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.
2012-08-29 02:36:22 +02:00
Nao Iizuka
f8ce384446 docs: correct the description of assert.ok() 2012-03-12 02:27:55 +01:00
isaacs
2d44dcc8be doc: Add stability indicators to documentation 2012-03-03 17:03:52 -08:00
isaacs
d383954ffe doc refactor: assert 2012-02-29 15:23:00 -08:00
Maciej Małecki
f4f037aa64 docs: Update assert module docs 2011-10-02 02:25:52 +02:00
Brian White
d22259426c Fix incorrect documentation for assert.fail()
Fixes #1100.
2011-05-24 10:44:14 -07:00
Oleg Slobodskoi
23cf938e4f fix assert.throws 2010-12-21 12:41:57 -08:00
Oleg Slobodskoi
c5c1dc5dda docs for assert.throws 2010-12-02 11:07:47 -08:00
Silas Sewell
11b2ee7632 Various doc tweaks (2-spaces vs tabs, EOL-whitespace, repl prompt, "world" vs "World", etc...) 2010-11-21 14:33:09 -08:00
Oleg Efimov
8b980d729c Fix line wrapping in docs. Add tics for constants in docs text. 2010-11-18 15:41:15 -08:00
Micheil Smith
e190c9616e Splitting documentation 2010-10-28 14:59:15 -07:00