From 51777a95ecaf39c88bce0ebe848b643125caee2c Mon Sep 17 00:00:00 2001 From: koooge Date: Mon, 25 Oct 2021 01:33:03 +0200 Subject: [PATCH 1/3] test: Import joi directly Signed-off-by: koooge --- __tests__/expects_jsonTypes_spec.js | 2 +- __tests__/expects_json_path_spec.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/__tests__/expects_jsonTypes_spec.js b/__tests__/expects_jsonTypes_spec.js index 8c8d53e..c559b47 100644 --- a/__tests__/expects_jsonTypes_spec.js +++ b/__tests__/expects_jsonTypes_spec.js @@ -1,7 +1,7 @@ 'use strict'; +const Joi = require('joi'); const frisby = require('../src/frisby'); -const Joi = frisby.Joi; const mocks = require('./fixtures/http_mocks'); const testHost = 'http://api.example.com'; diff --git a/__tests__/expects_json_path_spec.js b/__tests__/expects_json_path_spec.js index eb27e8b..4331938 100644 --- a/__tests__/expects_json_path_spec.js +++ b/__tests__/expects_json_path_spec.js @@ -1,7 +1,7 @@ 'use strict'; +const Joi = require('joi'); const frisby = require('../src/frisby'); -const Joi = frisby.Joi; const mocks = require('./fixtures/http_mocks'); const testHost = 'http://api.example.com'; @@ -168,4 +168,3 @@ describe('expect(\'json\', , )', function() { }); }); - From 9d8d6f9c81357654d33c562813098bbda157c8b1 Mon Sep 17 00:00:00 2001 From: koooge Date: Mon, 25 Oct 2021 01:37:56 +0200 Subject: [PATCH 2/3] feat: Don't export Joi Signed-off-by: koooge --- src/frisby.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/frisby.js b/src/frisby.js index 7f8fd3c..531eb80 100644 --- a/src/frisby.js +++ b/src/frisby.js @@ -1,7 +1,6 @@ 'use strict'; const _ = require('lodash'); -const Joi = require('joi'); const pkg = require('../package.json'); const FormData = require('form-data'); const FrisbySpec = require('./frisby/spec.js'); @@ -150,7 +149,6 @@ module.exports = { get: get, globalSetup, head, - Joi, // REVIEW: export? options, patch, post, From dd0754628e3b921fbc6879e4f5db17a8d8d17218 Mon Sep 17 00:00:00 2001 From: koooge Date: Mon, 25 Oct 2021 01:42:36 +0200 Subject: [PATCH 3/3] doc: Update link Signed-off-by: koooge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 165c0f2..7840e07 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ afterAll(function () { ### Expecting JSON types using Joi -With Frisby, you can use [Joi](https://github.com/hapijs/joi) to set the expectation that the JSON body response from the HTTP call meets a defined schema. Check out the [Joi API](https://github.com/hapijs/joi/blob/master/API.md) for more details. +With Frisby, you can use [Joi](https://github.com/sideway/joi) to set the expectation that the JSON body response from the HTTP call meets a defined schema. Check out the [joi.dev](https://joi.dev/api/) for more details. ## Using Jasmine Matchers Directly