From 6f30e606fd68ce4c84eb2001eef16b54e28e9bc3 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Sat, 3 Feb 2018 10:33:39 -0800 Subject: [PATCH] fix: added nock scope back --- src/index.ts | 3 ++- src/nock.ts | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 58596ae..4a91fa6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import base from './base' import _catch from './catch' import {expect} from './chai' import env from './env' -import {nock} from './nock' +import {nock, NockScope} from './nock' import {stderr, stdout} from './stdmock' import stub from './stub' @@ -21,5 +21,6 @@ export type Fancy = typeof fancy export { expect, FancyTypes, + NockScope, } export default fancy diff --git a/src/nock.ts b/src/nock.ts index 6d57ea7..acefe75 100644 --- a/src/nock.ts +++ b/src/nock.ts @@ -1,7 +1,7 @@ import * as _ from 'lodash' import * as Nock from 'nock' -export function nock(host?: string, cb?: (nock: nock.Scope) => any) { +export function nock(host?: string, cb?: (nock: NockScope) => any) { if (_.isUndefined(host)) throw new Error('host is undefined') if (_.isUndefined(cb)) throw new Error('callback is undefined') @@ -21,6 +21,4 @@ export function nock(host?: string, cb?: (nock: nock.Scope) => any) { } } -export namespace nock { - export interface Scope extends Nock.Scope {} -} +export interface NockScope extends Nock.Scope {}