Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
fix: move nock to other module
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
nock is now in @fancy-test/nock
  • Loading branch information
jdx committed Feb 5, 2018
1 parent 99db9c7 commit d88f065
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 130 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ Uses [nock](https://github.com/node-nock/nock) to mock out HTTP calls to externa
Automatically calls `done()` to ensure the calls were made and `cleanAll()` to remove any pending requests.

```js
const fancy = require('fancy-test')
.register('nock', require('@fancy-test/nock'))

describe('nock tests', () => {
fancy
.nock('https://api.github.com', nock => {
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
"@types/chai": "^4.1.2",
"@types/lodash": "^4.14.100",
"@types/mocha": "^2.2.48",
"@types/nock": "^9.1.2",
"@types/node": "^9.4.0",
"@types/node-notifier": "^0.0.28",
"@types/read-pkg": "^3.0.0",
"@types/sinon": "^4.1.3",
"chai": "^4.1.2",
Expand All @@ -25,7 +23,6 @@
"eslint-config-anycli": "^1.3.2",
"http-call": "^5.0.2",
"mocha": "^5.0.0",
"nock": "^9.1.6",
"sinon": "^4.2.2",
"ts-node": "^4.1.0",
"typescript": "^2.7.1"
Expand Down
3 changes: 0 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import base from './base'
import _catch from './catch'
import {expect} from './chai'
import env from './env'
import {nock, NockScope} from './nock'
import {stderr, stdout} from './stdmock'
import stub from './stub'

Expand All @@ -12,7 +11,6 @@ export const fancy = base
.register('catch', _catch)
.register('env', env)
.register('stub', stub)
.register('nock', nock)
.register('stderr', stderr)
.register('stdout', stdout)

Expand All @@ -21,6 +19,5 @@ export type Fancy = typeof fancy
export {
expect,
FancyTypes,
NockScope,
}
export default fancy
24 changes: 0 additions & 24 deletions src/nock.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as _ from 'lodash'
* mocks an object's property
*/
export default function (object?: any, path?: string, value?: any) {
if (_.isUndefined(object) || _.isUndefined(path))throw new Error('should not be undefined')
if (object === undefined || path === undefined) throw new Error('should not be undefined')
return {
run(ctx: {stubs: any[]}) {
ctx.stubs = ctx.stubs || []
Expand Down
26 changes: 0 additions & 26 deletions test/nock.test.ts

This file was deleted.

76 changes: 3 additions & 73 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,7 @@
version "2.2.48"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.48.tgz#3523b126a0b049482e1c3c11877460f76622ffab"

"@types/nock@^9.1.2":
version "9.1.2"
resolved "https://registry.yarnpkg.com/@types/nock/-/nock-9.1.2.tgz#0515b27e3f6bbc11834d22508ad02e2921dd376a"
dependencies:
"@types/node" "*"

"@types/node-notifier@^0.0.28":
version "0.0.28"
resolved "https://registry.yarnpkg.com/@types/node-notifier/-/node-notifier-0.0.28.tgz#86ba3d3aa8d918352cc3191d88de328b20dc93c1"
dependencies:
"@types/node" "*"

"@types/node@*", "@types/node@^9.4.0":
"@types/node@^9.4.0":
version "9.4.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.0.tgz#b85a0bcf1e1cc84eb4901b7e96966aedc6f078d1"

Expand Down Expand Up @@ -177,14 +165,6 @@ callsites@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca"

"chai@>=1.9.2 <4.0.0":
version "3.5.0"
resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247"
dependencies:
assertion-error "^1.0.1"
deep-eql "^0.1.3"
type-detect "^1.0.0"

chai@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c"
Expand Down Expand Up @@ -329,28 +309,12 @@ debug@*, [email protected], debug@^3.1.0:
dependencies:
ms "2.0.0"

debug@^2.2.0:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
dependencies:
ms "2.0.0"

deep-eql@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2"
dependencies:
type-detect "0.1.1"

deep-eql@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
dependencies:
type-detect "^4.0.0"

deep-equal@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"

deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
Expand Down Expand Up @@ -782,10 +746,6 @@ json-stable-stringify-without-jsonify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"

json-stringify-safe@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"

just-extend@^1.1.26:
version "1.1.27"
resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-1.1.27.tgz#ec6e79410ff914e472652abfa0e603c03d60e905"
Expand Down Expand Up @@ -821,7 +781,7 @@ lodash.zip@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020"

lodash@^4.17.4, lodash@^4.3.0, lodash@^4.5.1, lodash@~4.17.2:
lodash@^4.17.4, lodash@^4.3.0, lodash@^4.5.1:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"

Expand Down Expand Up @@ -862,7 +822,7 @@ minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"

[email protected], mkdirp@^0.5.0, mkdirp@^0.5.1:
[email protected], mkdirp@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
dependencies:
Expand Down Expand Up @@ -905,20 +865,6 @@ nise@^1.2.0:
path-to-regexp "^1.7.0"
text-encoding "^0.6.4"

nock@^9.1.6:
version "9.1.6"
resolved "https://registry.yarnpkg.com/nock/-/nock-9.1.6.tgz#16395af4c45b0fd84d1a4a9668154e16fa6624db"
dependencies:
chai ">=1.9.2 <4.0.0"
debug "^2.2.0"
deep-equal "^1.0.0"
json-stringify-safe "^5.0.1"
lodash "~4.17.2"
mkdirp "^0.5.0"
propagate "0.4.0"
qs "^6.5.1"
semver "^5.3.0"

object-assign@^4.0.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
Expand Down Expand Up @@ -1006,18 +952,10 @@ progress@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"

[email protected]:
version "0.4.0"
resolved "https://registry.yarnpkg.com/propagate/-/propagate-0.4.0.tgz#f3fcca0a6fe06736a7ba572966069617c130b481"

pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"

qs@^6.5.1:
version "6.5.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"

ramda@^0.24.1:
version "0.24.1"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857"
Expand Down Expand Up @@ -1357,14 +1295,6 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"

[email protected]:
version "0.1.1"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822"

type-detect@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2"

type-detect@^4.0.0, type-detect@^4.0.5:
version "4.0.7"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.7.tgz#862bd2cf6058ad92799ff5a5b8cf7b6cec726198"
Expand Down

0 comments on commit d88f065

Please sign in to comment.