Skip to content

Commit

Permalink
Update tests for Node@8
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 13, 2017
1 parent 7b79c80 commit 6fef2bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions test/children.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ test('children', function (t) {
function () {
assert({type: 'ParagraphNode', children: {alpha: 'bravo'}});
},
/^AssertionError: `children` should be an array: `{ type: 'ParagraphNode', children: { alpha: 'bravo' } }`$/,
/`children` should be an array: `{ type: 'ParagraphNode', children: { alpha: 'bravo' } }`$/,
'should throw if given a non-node child in children'
);

t.throws(
function () {
assert({type: 'ParagraphNode', children: ['one']});
},
/^AssertionError: node should be an object: `'one'` in `{ type: 'ParagraphNode', children: \[ 'one' ] }`$/,
/node should be an object: `'one'` in `{ type: 'ParagraphNode', children: \[ 'one' ] }`$/,
'should throw if given a non-node child in children'
);

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

Expand Down
8 changes: 4 additions & 4 deletions test/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ test('node', function (t) {
function () {
assert();
},
/^AssertionError: node should be an object: `undefined`$/,
/node should be an object: `undefined`$/,
'should throw if not given a node (#1)'
);

t.throws(
function () {
assert(null);
},
/^AssertionError: node should be an object: `null`$/,
/node should be an object: `null`$/,
'should throw if not given a node (#2)'
);

t.throws(
function () {
assert('foo');
},
/^AssertionError: node should be an object: `'foo'`$/,
/node should be an object: `'foo'`$/,
'should throw if given a non-node (#1)'
);

t.throws(
function () {
assert(6);
},
/^AssertionError: node should be an object: `6`$/,
/node should be an object: `6`$/,
'should throw if not given a non-node (#2)'
);

Expand Down
4 changes: 2 additions & 2 deletions test/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ test('assert(RootNode)', function (t) {
function () {
assert({type: 'RootNode'});
},
/^AssertionError: parent should have `children`: `{ type: 'RootNode' }`$/,
/parent should have `children`: `{ type: 'RootNode' }`$/,
'should throw if a `RootNode` is not a parent'
);

t.throws(
function () {
assert({type: 'ParagraphNode', children: [{type: 'RootNode', children: []}]});
},
/^AssertionError: `RootNode` should not have a parent: `{ type: 'RootNode', children: \[] }` in `{ type: 'ParagraphNode',\n {2}children: \[ { type: 'RootNode', children: \[] } ] }`$/,
/`RootNode` should not have a parent: `{ type: 'RootNode', children: \[] }` in `{ type: 'ParagraphNode',\n {2}children: \[ { type: 'RootNode', children: \[] } ] }`$/,
'should throw if a `RootNode` has a parent'
);

Expand Down

0 comments on commit 6fef2bf

Please sign in to comment.