Skip to content

Commit eddf39f

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

File tree

15 files changed

+49
-49
lines changed

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

0 commit comments

Comments
 (0)