Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: use eslint #5053

Closed
wants to merge 37 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
06b7a92
tools: add eslint-plugin-markdown to tools
tflanagan Feb 3, 2016
7ef37e7
build: add jslint-docs
tflanagan Feb 3, 2016
b1d72c4
doc: fix zlib.markdown code examples
tflanagan Feb 3, 2016
f33102f
doc: fix vm.markdown code examples
tflanagan Feb 3, 2016
dce6f63
doc: fix v8.markdown code examples
tflanagan Feb 3, 2016
785cf8a
doc: fix util.markdown code examples
tflanagan Feb 3, 2016
28c097e
doc: fix url.markdown code examples
tflanagan Feb 3, 2016
12c2164
doc: fix tls.markdown code examples
tflanagan Feb 3, 2016
a1ccb3f
doc: fix synopsis.markdown code examples
tflanagan Feb 3, 2016
0a8e050
doc: fix string_decoder.markdown code examples
tflanagan Feb 3, 2016
a092aff
doc: fix stream.markdown code examples
tflanagan Feb 3, 2016
844a648
doc: fix repl.markdown code examples
tflanagan Feb 3, 2016
fe84729
doc: fix readline.markdown code examples
tflanagan Feb 3, 2016
cd82e93
doc: fix querystring.markdown code examples
tflanagan Feb 3, 2016
aec9d27
doc: fix process.markdown code examples
tflanagan Feb 3, 2016
91b5733
doc: fix path.markdown code examples
tflanagan Feb 3, 2016
8a0517d
doc: fix punycode.markdown code examples
tflanagan Feb 3, 2016
2141a53
doc: fix os.markdown code examples
tflanagan Feb 3, 2016
eeb11f6
doc: fix net.markdown code examples
tflanagan Feb 3, 2016
fe80931
doc: fix modules.markdown code examples
tflanagan Feb 3, 2016
4ea4dec
doc: fix https.markdown code examples
tflanagan Feb 3, 2016
d6192c5
doc: fix http.markdown code examples
tflanagan Feb 3, 2016
4484863
doc: fix fs.markdown code examples
tflanagan Feb 3, 2016
a9e421d
doc: fix events.markdown code examples
tflanagan Feb 3, 2016
cf3685d
doc: fix errors.markdown code examples
tflanagan Feb 3, 2016
26de732
doc: fix domain.markdown code examples
tflanagan Feb 3, 2016
f9dfcef
doc: fix dgram.markdown code examplesc
tflanagan Feb 3, 2016
9f9243e
doc: fix debugger.markdown code examplesc
tflanagan Feb 3, 2016
4c16952
doc: fix addons.markdown code examples
tflanagan Feb 3, 2016
8686f19
doc: fix assert.markdown code examples
tflanagan Feb 3, 2016
3a362a9
doc: fix child_process.markdown code examples
tflanagan Feb 3, 2016
b05d621
doc: fix console.markdown code examples
tflanagan Feb 3, 2016
4c28eb4
doc: fix cluster.markdown code examples
tflanagan Feb 3, 2016
66c4081
doc: fix crypto.markdown code examples
tflanagan Feb 3, 2016
775cf49
doc: fix buffer.markdown code examples
tflanagan Feb 3, 2016
5d58b3f
build,doc: moving doc lint rules to doc/api/.eslintrc
tflanagan Feb 12, 2016
cb5c1dd
build: add jslint-docs to test
tflanagan Feb 17, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: fix assert.markdown code examples
  • Loading branch information
tflanagan committed Feb 10, 2016
commit 8686f19c1575c7b9b690afcb8da971826c259cf9
22 changes: 18 additions & 4 deletions doc/api/assert.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ results. For example, the following example does not throw an `AssertionError`
because the properties on the [`Error`][] object are non-enumerable:

```js
const assert = require('assert');

// WARNING: This does not throw an AssertionError!
assert.deepEqual(Error('a'), Error('b'));
```
Expand All @@ -65,7 +67,7 @@ const obj3 = {
a : {
b : 1
}
}
};
const obj4 = Object.create(obj1);

assert.deepEqual(obj1, obj1);
Expand Down Expand Up @@ -124,6 +126,8 @@ The following, for instance, will throw the [`TypeError`][] because there is no
matching error type in the assertion:

```js
const assert = require('assert');

assert.doesNotThrow(
() => {
throw new TypeError('Wrong value');
Expand All @@ -136,6 +140,8 @@ However, the following will result in an `AssertionError` with the message
'Got unwanted exception (TypeError)..':

```js
const assert = require('assert');

assert.doesNotThrow(
() => {
throw new TypeError('Wrong value');
Expand All @@ -149,6 +155,8 @@ parameter, the value of `message` will be appended to the `AssertionError`
message:

```js
const assert = require('assert');

assert.doesNotThrow(
() => {
throw new TypeError('Wrong value');
Expand Down Expand Up @@ -208,7 +216,7 @@ const assert = require('assert');

assert.ifError(0); // OK
assert.ifError(1); // Throws 1
assert.ifError('error') // Throws 'error'
assert.ifError('error'); // Throws 'error'
assert.ifError(new Error()); // Throws Error
```

Expand All @@ -233,7 +241,7 @@ const obj3 = {
a : {
b : 1
}
}
};
const obj4 = Object.create(obj1);

assert.notDeepEqual(obj1, obj1);
Expand Down Expand Up @@ -366,6 +374,8 @@ constructor, [`RegExp`][], or validation function.
Validate instanceof using constructor:

```js
const assert = require('assert');

assert.throws(
() => {
throw new Error('Wrong value');
Expand All @@ -377,6 +387,8 @@ assert.throws(
Validate error message using [`RegExp`][]:

```js
const assert = require('assert');

assert.throws(
() => {
throw new Error('Wrong value');
Expand All @@ -388,12 +400,14 @@ assert.throws(
Custom error validation:

```js
const assert = require('assert');

assert.throws(
() => {
throw new Error('Wrong value');
},
function(err) {
if ( (err instanceof Error) && /value/.test(err) ) {
if ((err instanceof Error) && /value/.test(err)) {
return true;
}
},
Expand Down