Skip to content

Commit eddf39f

Browse files
committed
Update tests for Node@8
1 parent ecec213 commit eddf39f

15 files changed

+49
-49
lines changed

test/children.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ test('children', function (t) {
88
function () {
99
assert({type: 'paragraph', children: {alpha: 'bravo'}});
1010
},
11-
/^AssertionError: `children` should be an array: `{ type: 'paragraph', children: { alpha: 'bravo' } }`$/,
11+
/`children` should be an array: `{ type: 'paragraph', children: { alpha: 'bravo' } }`$/,
1212
'should throw if given a non-node child in children'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert({type: 'paragraph', children: ['one']});
1818
},
19-
/^AssertionError: node should be an object: `'one'` in `{ type: 'paragraph', children: \[ 'one' ] }`$/,
19+
/node should be an object: `'one'` in `{ type: 'paragraph', children: \[ 'one' ] }`$/,
2020
'should throw if given a non-node child in children'
2121
);
2222

@@ -34,7 +34,7 @@ test('children', function (t) {
3434
children: ['one']
3535
}]});
3636
},
37-
/^AssertionError: node should be an object: `'one'` in `{ type: 'bar', children: \[ 'one' ] }`$/,
37+
/node should be an object: `'one'` in `{ type: 'bar', children: \[ 'one' ] }`$/,
3838
'should throw on invalid descendants'
3939
);
4040

test/code.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('assert(code)', function (t) {
88
function () {
99
assert({type: 'code'});
1010
},
11-
/^AssertionError: text should have `value`: `{ type: 'code' }`$/,
11+
/text should have `value`: `{ type: 'code' }`$/,
1212
'should throw if `code` is not a text'
1313
);
1414

@@ -23,7 +23,7 @@ test('assert(code)', function (t) {
2323
function () {
2424
assert({type: 'code', lang: 0, value: ''});
2525
},
26-
/^AssertionError: `lang` must be `string`: `{ type: 'code', lang: 0, value: '' }`$/,
26+
/`lang` must be `string`: `{ type: 'code', lang: 0, value: '' }`$/,
2727
'should throw if `lang` is not a string'
2828
);
2929

test/definition.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ test('assert(definition)', function (t) {
88
function () {
99
assert({type: 'definition'});
1010
},
11-
/^AssertionError: `identifier` must be `string`: `{ type: 'definition' }`$/,
11+
/`identifier` must be `string`: `{ type: 'definition' }`$/,
1212
'should throw if `definition` has no `identifier`'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert({type: 'definition', identifier: 1});
1818
},
19-
/^AssertionError: `identifier` must be `string`: `{ type: 'definition', identifier: 1 }`$/,
19+
/`identifier` must be `string`: `{ type: 'definition', identifier: 1 }`$/,
2020
'should throw if `identifier` is not a `string`'
2121
);
2222

@@ -31,15 +31,15 @@ test('assert(definition)', function (t) {
3131
function () {
3232
assert({type: 'definition', identifier: '1', url: 1});
3333
},
34-
/^AssertionError: `url` must be `string`: `{ type: 'definition', identifier: '1', url: 1 }`$/,
34+
/`url` must be `string`: `{ type: 'definition', identifier: '1', url: 1 }`$/,
3535
'should throw if `identifier` is not a `string`'
3636
);
3737

3838
t.throws(
3939
function () {
4040
assert({type: 'definition', identifier: '1', title: 1});
4141
},
42-
/^AssertionError: `title` must be `string`: `{ type: 'definition', identifier: '1', title: 1 }`$/,
42+
/`title` must be `string`: `{ type: 'definition', identifier: '1', title: 1 }`$/,
4343
'should throw if `title` is not a `string`'
4444
);
4545

test/footnote-definition.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ test('assert(footnoteDefinition)', function (t) {
88
function () {
99
assert({type: 'footnoteDefinition'});
1010
},
11-
/^AssertionError: parent should have `children`: `{ type: 'footnoteDefinition' }`$/,
11+
/parent should have `children`: `{ type: 'footnoteDefinition' }`$/,
1212
'should throw if `footnoteDefinition` is not a parent'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert({type: 'footnoteDefinition', children: []});
1818
},
19-
/^AssertionError: `footnoteDefinition` must have `identifier`: `{ type: 'footnoteDefinition', children: \[] }`$/,
19+
/`footnoteDefinition` must have `identifier`: `{ type: 'footnoteDefinition', children: \[] }`$/,
2020
'should throw if `footnoteDefinition` has no identifier'
2121
);
2222

2323
t.throws(
2424
function () {
2525
assert({type: 'footnoteDefinition', identifier: 1, children: []});
2626
},
27-
/^AssertionError: `footnoteDefinition` must have `identifier`: `{ type: 'footnoteDefinition', identifier: 1, children: \[] }`$/,
27+
/`footnoteDefinition` must have `identifier`: `{ type: 'footnoteDefinition', identifier: 1, children: \[] }`$/,
2828
'should throw if `identifier` is not a `string`'
2929
);
3030

test/footnote-reference.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ test('assert(footnoteReference)', function (t) {
88
function () {
99
assert({type: 'footnoteReference'});
1010
},
11-
/^AssertionError: `identifier` must be `string`: `{ type: 'footnoteReference' }`$/,
11+
/`identifier` must be `string`: `{ type: 'footnoteReference' }`$/,
1212
'should throw if `footnoteReference` has no `identifier`'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert({type: 'footnoteReference', identifier: 1});
1818
},
19-
/^AssertionError: `identifier` must be `string`: `{ type: 'footnoteReference', identifier: 1 }`$/,
19+
/`identifier` must be `string`: `{ type: 'footnoteReference', identifier: 1 }`$/,
2020
'should throw if `identifier` is not a `string`'
2121
);
2222

test/heading.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ test('assert(heading)', function (t) {
88
function () {
99
assert({type: 'heading'});
1010
},
11-
/^AssertionError: parent should have `children`: `{ type: 'heading' }`$/,
11+
/parent should have `children`: `{ type: 'heading' }`$/,
1212
'should throw if a `heading` is not a parent'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert({type: 'heading', depth: 0, children: []});
1818
},
19-
/^AssertionError: `depth` should be gte `1`: `{ type: 'heading', depth: 0, children: \[] }`$/,
19+
/`depth` should be gte `1`: `{ type: 'heading', depth: 0, children: \[] }`$/,
2020
'should throw if `depth` is lower than 1'
2121
);
2222

2323
t.throws(
2424
function () {
2525
assert({type: 'heading', depth: 7, children: []});
2626
},
27-
/^AssertionError: `depth` should be lte `6`: `{ type: 'heading', depth: 7, children: \[] }`$/,
27+
/`depth` should be lte `6`: `{ type: 'heading', depth: 7, children: \[] }`$/,
2828
'should throw if `depth` is lower than 7'
2929
);
3030

test/image-reference.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ test('assert(imageReference)', function (t) {
88
function () {
99
assert({type: 'imageReference'});
1010
},
11-
/^AssertionError: `identifier` must be `string`: `{ type: 'imageReference' }`$/,
11+
/`identifier` must be `string`: `{ type: 'imageReference' }`$/,
1212
'should throw if `imageReference` has no `identifier`'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert({type: 'imageReference', identifier: 1});
1818
},
19-
/^AssertionError: `identifier` must be `string`: `{ type: 'imageReference', identifier: 1 }`$/,
19+
/`identifier` must be `string`: `{ type: 'imageReference', identifier: 1 }`$/,
2020
'should throw if `identifier` is not a `string`'
2121
);
2222

@@ -31,15 +31,15 @@ test('assert(imageReference)', function (t) {
3131
function () {
3232
assert({type: 'imageReference', identifier: '1', alt: 1});
3333
},
34-
/^AssertionError: `alt` must be `string`: `{ type: 'imageReference', identifier: '1', alt: 1 }`$/,
34+
/`alt` must be `string`: `{ type: 'imageReference', identifier: '1', alt: 1 }`$/,
3535
'should throw if `alt` is not a `string`'
3636
);
3737

3838
t.throws(
3939
function () {
4040
assert({type: 'imageReference', identifier: '1', referenceType: 1});
4141
},
42-
/^AssertionError: `referenceType` must be `shortcut`, `collapsed`, or `full`: `{ type: 'imageReference', identifier: '1', referenceType: 1 }`$/,
42+
/`referenceType` must be `shortcut`, `collapsed`, or `full`: `{ type: 'imageReference', identifier: '1', referenceType: 1 }`$/,
4343
'should throw if `referenceType` is not a `string`'
4444
);
4545

test/image.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ test('assert(image)', function (t) {
1515
function () {
1616
assert({type: 'image', url: 1});
1717
},
18-
/^AssertionError: `url` must be `string`: `{ type: 'image', url: 1 }`$/,
18+
/`url` must be `string`: `{ type: 'image', url: 1 }`$/,
1919
'should throw if `identifier` is not a `string`'
2020
);
2121

2222
t.throws(
2323
function () {
2424
assert({type: 'image', title: 1});
2525
},
26-
/^AssertionError: `title` must be `string`: `{ type: 'image', title: 1 }`$/,
26+
/`title` must be `string`: `{ type: 'image', title: 1 }`$/,
2727
'should throw if `title` is not a `string`'
2828
);
2929

3030
t.throws(
3131
function () {
3232
assert({type: 'image', alt: 1});
3333
},
34-
/^AssertionError: `alt` must be `string`: `{ type: 'image', alt: 1 }`$/,
34+
/`alt` must be `string`: `{ type: 'image', alt: 1 }`$/,
3535
'should throw if `alt` is not a `string`'
3636
);
3737

test/link-reference.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ test('assert(linkReference)', function (t) {
88
function () {
99
assert({type: 'linkReference'});
1010
},
11-
/^AssertionError: parent should have `children`: `{ type: 'linkReference' }`$/,
11+
/parent should have `children`: `{ type: 'linkReference' }`$/,
1212
'should throw if `linkReference` has no children'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert({type: 'linkReference', children: []});
1818
},
19-
/^AssertionError: `identifier` must be `string`: `{ type: 'linkReference', children: \[] }`$/,
19+
/`identifier` must be `string`: `{ type: 'linkReference', children: \[] }`$/,
2020
'should throw if `linkReference` has no `identifier`'
2121
);
2222

2323
t.throws(
2424
function () {
2525
assert({type: 'linkReference', identifier: 1, children: []});
2626
},
27-
/^AssertionError: `identifier` must be `string`: `{ type: 'linkReference', identifier: 1, children: \[] }`$/,
27+
/`identifier` must be `string`: `{ type: 'linkReference', identifier: 1, children: \[] }`$/,
2828
'should throw if `identifier` is not a `string`'
2929
);
3030

@@ -39,7 +39,7 @@ test('assert(linkReference)', function (t) {
3939
function () {
4040
assert({type: 'linkReference', identifier: '1', referenceType: 1, children: []});
4141
},
42-
/^AssertionError: `referenceType` must be `shortcut`, `collapsed`, or `full`: `{ type: 'linkReference',\n {2}identifier: '1',\n {2}referenceType: 1,\n {2}children: \[] }`$/,
42+
/`referenceType` must be `shortcut`, `collapsed`, or `full`: `{ type: 'linkReference',\n {2}identifier: '1',\n {2}referenceType: 1,\n {2}children: \[] }`$/,
4343
'should throw if `referenceType` is not a `string`'
4444
);
4545

test/link.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('assert(link)', function (t) {
88
function () {
99
assert({type: 'link'});
1010
},
11-
/^AssertionError: parent should have `children`: `{ type: 'link' }`$/,
11+
/parent should have `children`: `{ type: 'link' }`$/,
1212
'should throw if `link` is not a parent'
1313
);
1414

@@ -23,15 +23,15 @@ test('assert(link)', function (t) {
2323
function () {
2424
assert({type: 'link', children: [], url: 1});
2525
},
26-
/^AssertionError: `url` must be `string`: `{ type: 'link', children: \[], url: 1 }`$/,
26+
/`url` must be `string`: `{ type: 'link', children: \[], url: 1 }`$/,
2727
'should throw if `identifier` is not a `string`'
2828
);
2929

3030
t.throws(
3131
function () {
3232
assert({type: 'link', children: [], title: 1});
3333
},
34-
/^AssertionError: `title` must be `string`: `{ type: 'link', children: \[], title: 1 }`$/,
34+
/`title` must be `string`: `{ type: 'link', children: \[], title: 1 }`$/,
3535
'should throw if `title` is not a `string`'
3636
);
3737

test/list-item.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('assert(listItem)', function (t) {
88
function () {
99
assert({type: 'listItem'});
1010
},
11-
/^AssertionError: parent should have `children`: `{ type: 'listItem' }`$/,
11+
/parent should have `children`: `{ type: 'listItem' }`$/,
1212
'should throw if a `listItem` is not a parent'
1313
);
1414

@@ -23,7 +23,7 @@ test('assert(listItem)', function (t) {
2323
function () {
2424
assert({type: 'listItem', loose: 1, children: []});
2525
},
26-
/^AssertionError: `loose` must be `boolean`: `{ type: 'listItem', loose: 1, children: \[] }`$/,
26+
/`loose` must be `boolean`: `{ type: 'listItem', loose: 1, children: \[] }`$/,
2727
'should throw if `loose` is not a `boolean`'
2828
);
2929

@@ -38,7 +38,7 @@ test('assert(listItem)', function (t) {
3838
function () {
3939
assert({type: 'listItem', checked: 'yup', children: []});
4040
},
41-
/^AssertionError: `checked` must be `boolean`: `{ type: 'listItem', checked: 'yup', children: \[] }`$/,
41+
/`checked` must be `boolean`: `{ type: 'listItem', checked: 'yup', children: \[] }`$/,
4242
'should throw if a `checked` is not a `boolean`'
4343
);
4444

test/list.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('assert(list)', function (t) {
88
function () {
99
assert({type: 'list'});
1010
},
11-
/^AssertionError: parent should have `children`: `{ type: 'list' }`$/,
11+
/parent should have `children`: `{ type: 'list' }`$/,
1212
'should throw if a `list` is not a parent'
1313
);
1414

@@ -23,7 +23,7 @@ test('assert(list)', function (t) {
2323
function () {
2424
assert({type: 'list', loose: 1, children: []});
2525
},
26-
/^AssertionError: `loose` must be `boolean`: `{ type: 'list', loose: 1, children: \[] }`$/,
26+
/`loose` must be `boolean`: `{ type: 'list', loose: 1, children: \[] }`$/,
2727
'should throw if `loose` is not a `boolean`'
2828
);
2929

@@ -38,7 +38,7 @@ test('assert(list)', function (t) {
3838
function () {
3939
assert({type: 'list', ordered: 'yup', children: []});
4040
},
41-
/^AssertionError: `ordered` must be `boolean`: `{ type: 'list', ordered: 'yup', children: \[] }`$/,
41+
/`ordered` must be `boolean`: `{ type: 'list', ordered: 'yup', children: \[] }`$/,
4242
'should throw if a `ordered` is not a `boolean`'
4343
);
4444

@@ -53,23 +53,23 @@ test('assert(list)', function (t) {
5353
function () {
5454
assert({type: 'list', ordered: false, start: 1, children: []});
5555
},
56-
/^AssertionError: unordered lists must not have `start`: `{ type: 'list', ordered: false, start: 1, children: \[] }`$/,
56+
/unordered lists must not have `start`: `{ type: 'list', ordered: false, start: 1, children: \[] }`$/,
5757
'should throw if an `ordered: false` list has a `start`'
5858
);
5959

6060
t.throws(
6161
function () {
6262
assert({type: 'list', ordered: true, start: false, children: []});
6363
},
64-
/^AssertionError: ordered lists must have `start`: `{ type: 'list', ordered: true, start: false, children: \[] }`$/,
64+
/ordered lists must have `start`: `{ type: 'list', ordered: true, start: false, children: \[] }`$/,
6565
'should throw if an `ordered` list has a non-numeric `start`'
6666
);
6767

6868
t.throws(
6969
function () {
7070
assert({type: 'list', ordered: true, start: -1, children: []});
7171
},
72-
/^AssertionError: `start` must be gte `0`: `{ type: 'list', ordered: true, start: -1, children: \[] }`$/,
72+
/`start` must be gte `0`: `{ type: 'list', ordered: true, start: -1, children: \[] }`$/,
7373
'should throw if an `ordered` list has a negative `start`'
7474
);
7575

test/node.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@ test('node', function (t) {
88
function () {
99
assert();
1010
},
11-
/^AssertionError: node should be an object: `undefined`$/,
11+
/node should be an object: `undefined`$/,
1212
'should throw if not given a node (#1)'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert(null);
1818
},
19-
/^AssertionError: node should be an object: `null`$/,
19+
/node should be an object: `null`$/,
2020
'should throw if not given a node (#2)'
2121
);
2222

2323
t.throws(
2424
function () {
2525
assert('foo');
2626
},
27-
/^AssertionError: node should be an object: `'foo'`$/,
27+
/node should be an object: `'foo'`$/,
2828
'should throw if given a non-node (#1)'
2929
);
3030

3131
t.throws(
3232
function () {
3333
assert(6);
3434
},
35-
/^AssertionError: node should be an object: `6`$/,
35+
/node should be an object: `6`$/,
3636
'should throw if not given a non-node (#2)'
3737
);
3838

0 commit comments

Comments
 (0)