Skip to content

Commit

Permalink
convert test/node-unit/stack-trace-filter.spec.js to unexpected
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
  • Loading branch information
boneskull committed Apr 21, 2018
1 parent be6c332 commit 454018b
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions test/node-unit/stack-trace-filter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ describe('stackTraceFilter()', function () {
'Immediate._onImmediate (/usr/local/lib/node_modules/mocha/lib/runner.js:276:5)',
'at processImmediate [as _immediateCallback] (timers.js:321:17)'
];
expect(filter(stack.join('\n')))
.to.equal(stack.slice(0, 3)
.join('\n'));
expect(filter(stack.join('\n')), 'to be', stack.slice(0, 3).join('\n'));

stack = [
'AssertionError: bar baz',
Expand All @@ -46,9 +44,7 @@ describe('stackTraceFilter()', function () {
'at processImmediate [as _immediateCallback] (timers.js:321:17)'
];

expect(filter(stack.join('\n')))
.to.equal(stack.slice(0, 7)
.join('\n'));
expect(filter(stack.join('\n')), 'to be', stack.slice(0, 7).join('\n'));
});

it('does not ignore other bower_components and components', function () {
Expand All @@ -67,9 +63,7 @@ describe('stackTraceFilter()', function () {
'at file:///.../components/mochajs/mocha/2.1.0/mocha.js:4970:12',
'at next (file:///.../components/mochajs/mocha/2.1.0/mocha.js:4817:14)'
];
expect(filter(stack.join('\n')))
.to.equal(stack.slice(0, 7)
.join('\n'));
expect(filter(stack.join('\n')), 'to be', stack.slice(0, 7).join('\n'));
});

it('should replace absolute with relative paths', function () {
Expand All @@ -85,8 +79,7 @@ describe('stackTraceFilter()', function () {
'at bar (/usr/local/dev/own/tmp/node_modules/bluebird/js/main/promise.js:11:26)'
];

expect(filter(stack.join('\n')))
.to.equal(expected.join('\n'));
expect(filter(stack.join('\n')), 'to be', expected.join('\n'));
});

it('should not replace absolute path which has cwd as infix', function () {
Expand All @@ -102,8 +95,7 @@ describe('stackTraceFilter()', function () {
'at bar (/usr/local/dev/own/tmp/node_modules/bluebird/js/main/promise.js:11:26)'
];

expect(filter(stack.join('\n')))
.to.equal(expected.join('\n'));
expect(filter(stack.join('\n')), 'to be', expected.join('\n'));
});
});

Expand Down Expand Up @@ -154,9 +146,7 @@ describe('stackTraceFilter()', function () {
'at localhost:3000/foo/bar/node_modules/mocha.js:4970:12',
'at next (node_modules/mocha.js:4817:14)'
];
expect(filter(stack.join('\n')))
.to.equal(stack.slice(0, 7)
.join('\n'));
expect(filter(stack.join('\n')), 'to be', stack.slice(0, 7).join('\n'));
});

after(function () {
Expand Down

0 comments on commit 454018b

Please sign in to comment.