Skip to content

Commit 047c8a7

Browse files
committed
Fix tests on newer Node
1 parent c016fc8 commit 047c8a7

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

test/children.js

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

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

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

test/comment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test('assert(comment)', function (t) {
99
function () {
1010
assert({type: 'comment'});
1111
},
12-
/^AssertionError: text should have `value`: `{ type: 'comment' }`$/,
12+
/text should have `value`: `{ type: 'comment' }`$/,
1313
'should throw if a `comment` doesn’t have a value'
1414
);
1515

test/doctype.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test('assert(doctype)', function (t) {
99
function () {
1010
assert({type: 'doctype'});
1111
},
12-
/^AssertionError: `doctype` should have a `name`: `{ type: 'doctype' }`$/,
12+
/`doctype` should have a `name`: `{ type: 'doctype' }`$/,
1313
'should throw if a `doctype` doesn’t have a name'
1414
);
1515

@@ -31,15 +31,15 @@ test('assert(doctype)', function (t) {
3131
function () {
3232
assert({type: 'doctype', name: 'html', public: true});
3333
},
34-
/^AssertionError: `doctype.public` should be `string`: `{ type: 'doctype', name: 'html', public: true }`$/,
34+
/`doctype.public` should be `string`: `{ type: 'doctype', name: 'html', public: true }`$/,
3535
'should throw if a `public` isn’t string'
3636
);
3737

3838
t.throws(
3939
function () {
4040
assert({type: 'doctype', name: 'html', system: false});
4141
},
42-
/^AssertionError: `doctype.system` should be `string`: `{ type: 'doctype', name: 'html', system: false }`$/,
42+
/`doctype.system` should be `string`: `{ type: 'doctype', name: 'html', system: false }`$/,
4343
'should throw if a `system` isn’t string'
4444
);
4545

test/element.js

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

1616
t.throws(
1717
function () {
1818
assert({type: 'element', children: []});
1919
},
20-
/^AssertionError: `element` should have a `tagName`: `{ type: 'element', children: \[] }`$/,
20+
/`element` should have a `tagName`: `{ type: 'element', children: \[] }`$/,
2121
'should throw if a `element` has no `tagName`'
2222
);
2323

2424
t.throws(
2525
function () {
2626
assert({type: 'element', tagName: '', children: []});
2727
},
28-
/^AssertionError: `element.tagName` should not be empty: `{ type: 'element', tagName: '', children: \[] }`$/,
28+
/`element.tagName` should not be empty: `{ type: 'element', tagName: '', children: \[] }`$/,
2929
'should throw if a `element` has an empty `tagName`'
3030
);
3131

test/node.js

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

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

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

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

test/root.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ test('assert(root)', function (t) {
99
function () {
1010
assert({type: 'root'});
1111
},
12-
/^AssertionError: parent should have `children`: `{ type: 'root' }`$/,
12+
/parent should have `children`: `{ type: 'root' }`$/,
1313
'should throw if a `root` is not a parent'
1414
);
1515

1616
t.throws(
1717
function () {
1818
assert({type: 'root', children: [{type: 'root', children: []}]});
1919
},
20-
/^AssertionError: `root` should not have a parent: `{ type: 'root', children: \[] }` in `{ type: 'root', children: \[ { type: 'root', children: \[] } ] }`$/,
20+
/`root` should not have a parent: `{ type: 'root', children: \[] }` in `{ type: 'root', children: \[ { type: 'root', children: \[] } ] }`$/,
2121
'should throw if a `root` has a parent'
2222
);
2323

test/text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test('assert(text)', function (t) {
99
function () {
1010
assert({type: 'text'});
1111
},
12-
/^AssertionError: text should have `value`: `{ type: 'text' }`$/,
12+
/text should have `value`: `{ type: 'text' }`$/,
1313
'should throw if a `text` doesn’t have a value'
1414
);
1515

0 commit comments

Comments
 (0)