Skip to content

Commit 5c07510

Browse files
committed
minor change on test names
1 parent 1c9afa5 commit 5c07510

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

test/plugin-falls-back-to-json.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Hapi = require('hapi')
66

77
let server
88

9-
const { experiment, test, before } = (exports.lab = Lab.script())
9+
const { experiment, it, before } = (exports.lab = Lab.script())
1010

1111
experiment('hapi-dev-error falls back to json', () => {
1212
before(async () => {
@@ -32,7 +32,7 @@ experiment('hapi-dev-error falls back to json', () => {
3232
server.route(routeOptions)
3333
})
3434

35-
test('test if the plugin responds json with json accept header', async () => {
35+
it('responds json with json accept header', async () => {
3636
const response = await server.inject({
3737
url: '/error',
3838
method: 'GET',
@@ -46,7 +46,7 @@ experiment('hapi-dev-error falls back to json', () => {
4646
Code.expect(payload).to.startWith('{')
4747
})
4848

49-
test('test if the plugin responds json with curl user-agent', async () => {
49+
it('responds json with curl user-agent', async () => {
5050
const response = await server.inject({
5151
url: '/error',
5252
method: 'GET',

test/plugin-is-enabled-when-not-in-production.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const Path = require('path')
88

99
let server
1010

11-
const { experiment, test, before, beforeEach } = (exports.lab = Lab.script())
11+
const { experiment, it, before, beforeEach } = (exports.lab = Lab.script())
1212
const expect = Code.expect
1313

1414
experiment('hapi-dev-error register plugin', () => {
@@ -26,7 +26,7 @@ experiment('hapi-dev-error register plugin', () => {
2626
})
2727
})
2828

29-
test('test if the plugin is enabled in development for web requests', async () => {
29+
it('is enabled in development for web requests', async () => {
3030
const routeOptions = {
3131
path: '/showErrorsForWeb',
3232
method: 'GET',
@@ -49,7 +49,7 @@ experiment('hapi-dev-error register plugin', () => {
4949
expect(payload).to.startWith('<!DOCTYPE html>')
5050
})
5151

52-
test('test if the plugin is enabled in development for JSON/REST requests', async () => {
52+
it('is enabled in development for JSON/REST requests', async () => {
5353
const routeOptions = {
5454
path: '/showErrorsForREST',
5555
method: 'GET',
@@ -77,7 +77,7 @@ experiment('hapi-dev-error register plugin', () => {
7777
expect(payload.method).to.equal(routeOptions.method)
7878
})
7979

80-
test('test when the error is from a rejected Promise', async () => {
80+
it('test when the error is from a rejected Promise', async () => {
8181
const routeOptions = {
8282
path: '/showPromiseError',
8383
method: 'GET',
@@ -105,7 +105,7 @@ experiment('hapi-dev-error register plugin', () => {
105105
expect(payload.method).to.equal(routeOptions.method)
106106
})
107107

108-
test('test if the request payload is added to the error response', async () => {
108+
it('test if the request payload is added to the error response', async () => {
109109
const routeOptions = {
110110
path: '/with-request-payload',
111111
method: 'POST',
@@ -167,7 +167,7 @@ experiment('hapi-dev-error renders a custom template', () => {
167167
})
168168
})
169169

170-
test('render a template', async () => {
170+
it('render a template', async () => {
171171
const routeOptions = {
172172
path: '/custom-view',
173173
method: 'GET',

test/plugin-uses-links.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const Code = require('code')
55
const Hapi = require('hapi')
66
const Sinon = require('sinon')
77

8-
const { experiment, test, beforeEach, afterEach } = (exports.lab = Lab.script())
8+
const { experiment, it, beforeEach, afterEach } = (exports.lab = Lab.script())
99

1010
experiment('hapi-dev-error handles custom user links', () => {
1111
async function createServer (options) {
@@ -39,7 +39,7 @@ experiment('hapi-dev-error handles custom user links', () => {
3939
console.error.restore()
4040
})
4141

42-
test('that the plugin works fine with empty links', async () => {
42+
it('works fine with empty links', async () => {
4343
const server = await createServer({ links: [] })
4444

4545
const response = await server.inject({
@@ -53,7 +53,7 @@ experiment('hapi-dev-error handles custom user links', () => {
5353
Code.expect(response.payload).to.startWith('<')
5454
})
5555

56-
test('that the plugin throws if the links are strings', async () => {
56+
it('throws if the links are strings', async () => {
5757
const server = await createServer({ links: [ 'error' ] })
5858

5959
const response = await server.inject({
@@ -68,7 +68,7 @@ experiment('hapi-dev-error handles custom user links', () => {
6868
Code.expect(response.payload).to.include('Internal Server Error')
6969
})
7070

71-
test('that the plugin throws if the links is not an array of functions', async () => {
71+
it('throws if the links is not an array of functions', async () => {
7272
const server = await createServer({ links: 'error' })
7373

7474
const response = await server.inject({
@@ -83,7 +83,7 @@ experiment('hapi-dev-error handles custom user links', () => {
8383
Code.expect(response.payload).to.include('Internal Server Error')
8484
})
8585

86-
test('that the plugin works fine with a link function', async () => {
86+
it('works fine with a link function', async () => {
8787
const server = await createServer({ links: () => `link` })
8888

8989
const response = await server.inject({

0 commit comments

Comments
 (0)