Skip to content

Commit

Permalink
Merge 2e9c712 into e8f512b
Browse files Browse the repository at this point in the history
  • Loading branch information
zemccartney committed Nov 9, 2017
2 parents e8f512b + 2e9c712 commit ae74010
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
node_modules
package-lock.json
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -3,6 +3,6 @@ language: node_js
node_js:
- "4"
- "6"
- "7"
- "8"

after_script: "npm run coveralls"
8 changes: 4 additions & 4 deletions API.md
Expand Up @@ -97,7 +97,7 @@ server.route({
### `Toys.pre(server, notation, [options])`
> As instance, `toys.pre(notation, [options])`
Returns a [route prerequisite object](https://github.com/hapijs/hapi/blob/master/API.md#route-prerequisites) given a hapi `server`, a short-hand string `notation` (described [above](#notation-format)) referencing a server method on that server, and optional `options` to set the prerequisite's `assign` or `failAction`. By default `assign` is set to the server method's name.
Returns a [route prerequisite object](https://github.com/hapijs/hapi/blob/v16/API.md#route-prerequisites) given a hapi `server`, a short-hand string `notation` (described [above](#notation-format)) referencing a server method on that server, and optional `options` to set the prerequisite's `assign` or `failAction`. By default `assign` is set to the server method's name.

```js
server.method({
Expand Down Expand Up @@ -126,7 +126,7 @@ server.route({
### `Toys.ext(method, [options])`
> As instance, `toys.ext(method, [options])`
Returns a hapi [extension config](https://github.com/hapijs/hapi/blob/master/API.md#serverextevents) `{ method, options }` without the `type` field. The config only has `options` set when provided as an argument. This intended to be used with the route `ext` config.
Returns a hapi [extension config](https://github.com/hapijs/hapi/blob/v16/API.md#serverextevents) `{ method, options }` without the `type` field. The config only has `options` set when provided as an argument. This intended to be used with the route `ext` config.

```js
server.route({
Expand Down Expand Up @@ -154,7 +154,7 @@ server.route({
### `Toys.EXTENSION(method, [options])`
> As instance, `toys.EXTENSION(method, [options])`
Returns a hapi [extension config](https://github.com/hapijs/hapi/blob/master/API.md#serverextevents) `{ type, method, options}` with the `type` field set to `EXTENSION`, where `EXTENSION` is any of `onRequest`, `onPreAuth`, `onPostAuth`, `onPreHandler`, `onPostHandler`, `onPreResponse`, `onPreStart`, `onPostStart`, `onPreStop`, or `onPostStop`. The config only has `options` set when provided as an argument. This is intended to be used with [`server.ext()`](https://github.com/hapijs/hapi/blob/master/API.md#serverextevents).
Returns a hapi [extension config](https://github.com/hapijs/hapi/blob/v16/API.md#serverextevents) `{ type, method, options}` with the `type` field set to `EXTENSION`, where `EXTENSION` is any of `onRequest`, `onPreAuth`, `onPostAuth`, `onPreHandler`, `onPostHandler`, `onPreResponse`, `onPreStart`, `onPostStart`, `onPreStop`, or `onPostStop`. The config only has `options` set when provided as an argument. This is intended to be used with [`server.ext()`](https://github.com/hapijs/hapi/blob/v16/API.md#serverextevents).

```js
server.ext([
Expand Down Expand Up @@ -278,7 +278,7 @@ server.route({
### `Toys.auth.strategy(server, name, authenticate)`
> As instance, `toys.auth.strategy(name, authenticate)`
Adds an auth scheme and strategy with name `name` to `server`. Its implementation is given by `authenticate` as described in [`server.auth.scheme()`](https://github.com/hapijs/hapi/blob/master/API.md#serverauthschemename-scheme). This is intended to make it simple to create a barebones auth strategy without having to create a reusable auth scheme; it is often useful for testing and simple auth implementations.
Adds an auth scheme and strategy with name `name` to `server`. Its implementation is given by `authenticate` as described in [`server.auth.scheme()`](https://github.com/hapijs/hapi/blob/v16/API.md#serverauthschemename-scheme). This is intended to make it simple to create a barebones auth strategy without having to create a reusable auth scheme; it is often useful for testing and simple auth implementations.

```js
Toys.auth.strategy(server, 'simple-bearer', (request, reply) => {
Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,8 @@ The hapi utility toy chest

[![Build Status](https://travis-ci.org/devinivy/toys.svg?branch=master)](https://travis-ci.org/devinivy/toys) [![Coverage Status](https://coveralls.io/repos/devinivy/toys/badge.svg?branch=master&service=github)](https://coveralls.io/github/devinivy/toys?branch=master)

Lead Maintainer - [Devin Ivy](https://github.com/devinivy)

## Usage
> See also the [API Reference](API.md)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -31,11 +31,11 @@
"hoek": "4.x.x"
},
"devDependencies": {
"boom": "4.x.x",
"boom": "5.x.x",
"code": "4.x.x",
"coveralls": "2.x.x",
"coveralls": "3.x.x",
"hapi": "16.x.x",
"lab": "12.x.x",
"lab": "14.x.x",
"pinkie": "2.x.x"
}
}
3 changes: 1 addition & 2 deletions test/index.js
Expand Up @@ -1059,8 +1059,7 @@ describe('Toys', () => {
expect(value).to.equal('24carat');

return pifiedFn(new Error('0carat'));
})
.catch((err) => {
}).catch((err) => {

expect(err).to.be.instanceof(Error);
expect(err.message).to.equal('0carat');
Expand Down

0 comments on commit ae74010

Please sign in to comment.