Skip to content

Commit

Permalink
fix(dependencies): switched to the scoped version of boom
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Oct 3, 2019
1 parent 8a88e67 commit e269f5b
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 19 deletions.
169 changes: 157 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
"@babel/node": "^7.6.1",
"@babel/plugin-external-helpers": "^7.2.0",
"@babel/register": "^7.6.0",
"@hapi/boom": "^8.0.1",
"@hapi/glue": "^6.1.1",
"@travi/any": "^2.0.3",
"@travi/babel-preset": "^3.0.0",
"@travi/eslint-config-travi": "^1.8.4",
"@travi/hapi-html-request-router": "^3.0.0",
"boom": "^6.0.0",
"chai": "^4.2.0",
"chai-as-promised": "7.1.1",
"codecov": "^3.5.0",
Expand Down Expand Up @@ -83,7 +83,7 @@
"vision": "^5.4.4"
},
"peerDependencies": {
"boom": "^6.0.0",
"@hapi/boom": "^8.0.0",
"@hapi/hapi": "^18.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/router-wrapper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Boom from 'boom';
import Boom from '@hapi/boom';
import {MOVED_PERMANENTLY, MOVED_TEMPORARILY} from 'http-status-codes';
import matchRoute from './route-matcher';
import fetchData from './data-fetcher';
Expand Down Expand Up @@ -31,6 +31,6 @@ export default async function renderThroughReactRouter(request, h, {render, rout
});
}
} catch (e) {
throw Boom.wrap(e);
throw Boom.boomify(e);
}
}
6 changes: 3 additions & 3 deletions test/unit/router-wrapper-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {MOVED_PERMANENTLY, MOVED_TEMPORARILY} from 'http-status-codes';
import sinon from 'sinon';
import {assert} from 'chai';
import any from '@travi/any';
import Boom from 'boom';
import Boom from '@hapi/boom';
import renderThroughReactRouter from '../../src/router-wrapper';
import * as defaultRenderFactory from '../../src/default-render-factory';
import * as routeMatcher from '../../src/route-matcher';
Expand All @@ -22,7 +22,7 @@ suite('router-wrapper', () => {

sandbox.stub(routeMatcher, 'default');
sandbox.stub(dataFetcher, 'default');
sandbox.stub(Boom, 'wrap');
sandbox.stub(Boom, 'boomify');
sandbox.stub(defaultRenderFactory, 'default');
});

Expand Down Expand Up @@ -128,7 +128,7 @@ suite('router-wrapper', () => {
const error = new Error('from test');
const wrappedError = any.simpleObject();
routeMatcher.default.rejects(error);
Boom.wrap.withArgs(error).returns(wrappedError);
Boom.boomify.withArgs(error).returns(wrappedError);

return assert.isRejected(renderThroughReactRouter({raw: {req: {url: any.string()}}}, reply, {}), wrappedError);
});
Expand Down

0 comments on commit e269f5b

Please sign in to comment.