Skip to content

Commit 172ca7e

Browse files
committed
Update tests for Node@8
1 parent d4fb2f9 commit 172ca7e

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
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: 'foo', children: {alpha: 'bravo'}});
1010
},
11-
/^AssertionError: `children` should be an array: `{ type: 'foo', children: { alpha: 'bravo' } }`$/,
11+
/`children` should be an array: `{ type: 'foo', children: { alpha: 'bravo' } }`$/,
1212
'should throw if given a non-node child in children'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert({type: 'foo', children: ['one']});
1818
},
19-
/^AssertionError: node should be an object: `'one'` in `{ type: 'foo', children: \[ 'one' ] }`$/,
19+
/node should be an object: `'one'` in `{ type: 'foo', 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/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

test/non-defined.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test('non-defined', function (t) {
2929
data: {foo: Function}
3030
});
3131
},
32-
/^AssertionError: non-specced property `data` should be JSON: `{ type: 'break', data: { foo: \[Function: Function] } }`$/,
32+
/non-specced property `data` should be JSON: `{ type: 'break', data: { foo: \[Function: Function] } }`$/,
3333
'should throw if non-defined properties are not serialisable'
3434
);
3535

test/parent.js

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

1515
t.throws(
1616
function () {
1717
assert.parent({type: 'text', value: 'foo'});
1818
},
19-
/^AssertionError: parent should not have `value`: `{ type: 'text', value: 'foo' }`$/,
19+
/parent should not have `value`: `{ type: 'text', value: 'foo' }`$/,
2020
'should throw if the given node has a `value`'
2121
);
2222

2323
t.throws(
2424
function () {
2525
assert.parent({type: 'break'});
2626
},
27-
/^AssertionError: parent should have `children`: `{ type: 'break' }`$/,
27+
/parent should have `children`: `{ type: 'break' }`$/,
2828
'should throw if the given node has `children`'
2929
);
3030

test/position.js

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

@@ -30,7 +30,7 @@ test('position', function (t) {
3030
function () {
3131
assert({type: 'foo', position: {start: 1}});
3232
},
33-
/^AssertionError: `position.start` should be an object: `{ type: 'foo', position: { start: 1 } }`$/,
33+
/`position.start` should be an object: `{ type: 'foo', position: { start: 1 } }`$/,
3434
'should throw if given a non-object `position.start`'
3535
);
3636

@@ -52,7 +52,7 @@ test('position', function (t) {
5252
function () {
5353
assert({type: 'foo', position: {end: 1}});
5454
},
55-
/^AssertionError: `position.end` should be an object: `{ type: 'foo', position: { end: 1 } }`$/,
55+
/`position.end` should be an object: `{ type: 'foo', position: { end: 1 } }`$/,
5656
'should throw if given a non-object `position.end`'
5757
);
5858

@@ -102,31 +102,31 @@ test('position', function (t) {
102102
function () {
103103
assert({type: 'foo', position: {start: {line: 0}}});
104104
},
105-
/^AssertionError: `position.start.line` should be gte `1`: `{ type: 'foo', position: { start: { line: 0 } } }`$/,
105+
/`position.start.line` should be gte `1`: `{ type: 'foo', position: { start: { line: 0 } } }`$/,
106106
'should throw if `position.start.line` is less than 1'
107107
);
108108

109109
t.throws(
110110
function () {
111111
assert({type: 'foo', position: {start: {column: 0}}});
112112
},
113-
/^AssertionError: `position.start.column` should be gte `1`: `{ type: 'foo', position: { start: { column: 0 } } }`$/,
113+
/`position.start.column` should be gte `1`: `{ type: 'foo', position: { start: { column: 0 } } }`$/,
114114
'should throw if `position.start.column` is less than 1'
115115
);
116116

117117
t.throws(
118118
function () {
119119
assert({type: 'foo', position: {end: {line: 0}}});
120120
},
121-
/^AssertionError: `position.end.line` should be gte `1`: `{ type: 'foo', position: { end: { line: 0 } } }`$/,
121+
/`position.end.line` should be gte `1`: `{ type: 'foo', position: { end: { line: 0 } } }`$/,
122122
'should throw if `position.end.line` is less than 1'
123123
);
124124

125125
t.throws(
126126
function () {
127127
assert({type: 'foo', position: {end: {column: 0}}});
128128
},
129-
/^AssertionError: `position.end.column` should be gte `1`: `{ type: 'foo', position: { end: { column: 0 } } }`$/,
129+
/`position.end.column` should be gte `1`: `{ type: 'foo', position: { end: { column: 0 } } }`$/,
130130
'should throw if `position.end.column` is less than 1'
131131
);
132132

test/text.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ test('assert.text()', function (t) {
88
function () {
99
assert.text({});
1010
},
11-
/^AssertionError: node should have a type: `{}`$/,
11+
/node should have a type: `{}`$/,
1212
'should throw the same errors as `assert()`'
1313
);
1414

1515
t.throws(
1616
function () {
1717
assert.text({type: 'strong', children: []});
1818
},
19-
/^AssertionError: text should not have `children`: `{ type: 'strong', children: \[] }`$/,
19+
/text should not have `children`: `{ type: 'strong', children: \[] }`$/,
2020
'should throw if the given node has `children`'
2121
);
2222

2323
t.throws(
2424
function () {
2525
assert.text({type: 'break'});
2626
},
27-
/^AssertionError: text should have `value`: `{ type: 'break' }`$/,
27+
/text should have `value`: `{ type: 'break' }`$/,
2828
'should throw if the given node has no `value`'
2929
);
3030

test/type.js

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

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

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

3131
t.throws(
3232
function () {
3333
assert({type: ''});
3434
},
35-
/^AssertionError: `type` should not be empty: `{ type: '' }`$/,
35+
/`type` should not be empty: `{ type: '' }`$/,
3636
'should throw if given an empty string type'
3737
);
3838

test/value.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test('value', function (t) {
88
function () {
99
assert({type: 'foo', value: 1});
1010
},
11-
/^AssertionError: `value` should be a string: `{ type: 'foo', value: 1 }`$/,
11+
/`value` should be a string: `{ type: 'foo', value: 1 }`$/,
1212
'should throw if given a non-string `value`'
1313
);
1414

test/void.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ test('assert.void()', function (t) {
1919
function () {
2020
assert.void({});
2121
},
22-
/^AssertionError: node should have a type: `{}`$/,
22+
/node should have a type: `{}`$/,
2323
'should throw the same errors as `assert()`'
2424
);
2525

2626
t.throws(
2727
function () {
2828
assert.void({type: 'text', value: 'foo'});
2929
},
30-
/^AssertionError: void should not have `value`: `{ type: 'text', value: 'foo' }`$/,
30+
/void should not have `value`: `{ type: 'text', value: 'foo' }`$/,
3131
'should throw if the given node has a `value`'
3232
);
3333

3434
t.throws(
3535
function () {
3636
assert.void({type: 'strong', children: []});
3737
},
38-
/^AssertionError: void should not have `children`: `{ type: 'strong', children: \[] }`$/,
38+
/void should not have `children`: `{ type: 'strong', children: \[] }`$/,
3939
'should throw if the given node has `children`'
4040
);
4141

0 commit comments

Comments
 (0)