Skip to content

Commit

Permalink
refactor: destructure access to Code.expect
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianMurphy committed Nov 19, 2017
1 parent 5f31453 commit 46e708a
Show file tree
Hide file tree
Showing 43 changed files with 46 additions and 92 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Expand Up @@ -79,8 +79,8 @@ internals.schema = Joi.object({
skipProfile: internals.flexBoolean.optional().default(false),
forceHttps: internals.flexBoolean.optional().default(false),
location: Joi.alternatives().try(
Joi.func().maxArity(1),
Joi.string()
Joi.func().maxArity(1),
Joi.string()
).default(false),
runtimeStateCallback: Joi.func().optional()
});
Expand Down
6 changes: 3 additions & 3 deletions lib/oauth.js
Expand Up @@ -498,9 +498,9 @@ internals.Client.prototype.signature = function (method, baseUri, params, oauth,
normalized.sort((a, b) => {

return (a[0] < b[0] ? -1
: (a[0] > b[0] ? 1
: (a[1] < b[1] ? -1
: (a[1] > b[1] ? 1 : 0))));
: (a[0] > b[0] ? 1
: (a[1] < b[1] ? -1
: (a[1] > b[1] ? 1 : 0))));
});

let normalizedParam = '';
Expand Down
3 changes: 1 addition & 2 deletions test/index.js
Expand Up @@ -4,7 +4,7 @@

const Bell = require('../');
const Boom = require('boom');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -18,7 +18,6 @@ const OAuth = require('../lib/oauth');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


const privateKey = require('./constants.json').privateKey;
Expand Down
7 changes: 1 addition & 6 deletions test/mock.js
Expand Up @@ -4,7 +4,7 @@

const Querystring = require('querystring');
const Boom = require('boom');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hawk = require('hawk');
const Hoek = require('hoek');
Expand All @@ -15,11 +15,6 @@ const Wreck = require('wreck');

const internals = {};


// Test shortcuts

const expect = Code.expect;

exports.CLIENT_ID_TESTER = internals.CLIENT_ID_TESTER = 'clientIdTester';
exports.CLIENT_SECRET_TESTER = internals.CLIENT_SECRET_TESTER = 'clientSecretTester';

Expand Down
4 changes: 1 addition & 3 deletions test/oauth.js
Expand Up @@ -4,7 +4,7 @@

const Bell = require('../');
const Boom = require('boom');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -17,8 +17,6 @@ const OAuth = require('../lib/oauth');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;

const privateKey = require('./constants.json').privateKey;

describe('Bell', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/arcgisonline.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('arcgisonline', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/auth0.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('auth0', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/azuread.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


// Test helpers
Expand Down
3 changes: 1 addition & 2 deletions test/providers/bitbucket.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('bitbucket', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/digitalocean.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('digitalocean', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/discord.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('discord', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/dropbox-v2.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('dropbox-v2', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/dropbox.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('dropbox', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/facebook.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;

describe('facebook', () => {

Expand Down
3 changes: 1 addition & 2 deletions test/providers/fitbit.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('fitbit', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/foursquare.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('foursquare', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/github.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('github', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/gitlab.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('gitlab', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/google.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('google', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/googleplus.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('googleplus', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/instagram.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('instagram', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/linkedin.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('linkedin', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/providers/live.js
Expand Up @@ -3,7 +3,7 @@
// Load modules

const Bell = require('../../');
const Code = require('code');
const { expect } = require('code');
const { Server } = require('hapi');
const Hoek = require('hoek');
const Lab = require('lab');
Expand All @@ -15,7 +15,6 @@ const Mock = require('../mock');
const lab = exports.lab = Lab.script();
const describe = lab.describe;
const it = lab.it;
const expect = Code.expect;


describe('live', () => {
Expand Down

0 comments on commit 46e708a

Please sign in to comment.