Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): Disable got automatic retries which cause confusing behavior #1524

Merged
merged 1 commit into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/got_client.js
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
'use strict'

const got = require('got')

// https://github.com/nock/nock/issues/1523
module.exports = got.extend({ retry: 0 })
2 changes: 1 addition & 1 deletion tests/test_allow_unmocked.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 2,10 @@

const http = require('http')
const url = require('url')
const got = require('got')
const mikealRequest = require('request')
const { test } = require('tap')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_allow_unmocked_https.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 5,7 @@ const fs = require('fs')
const https = require('https')
const nock = require('..')
const ssl = require('./ssl')
const got = require('got')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_basic_auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 2,8 @@

const { test } = require('tap')
const assertRejects = require('assert-rejects')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_complex_querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 2,8 @@

const { test } = require('tap')
const qs = require('qs')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_content_encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 2,8 @@

const zlib = require('zlib')
const { test } = require('tap')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_default_reply_headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 4,7 @@

const { test } = require('tap')
const nock = require('..')
const got = require('got')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_define.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 2,8 @@

const http = require('http')
const { test } = require('tap')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_delay.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 5,10 @@ const path = require('path')
const http = require('http')
const stream = require('stream')
const assertRejects = require('assert-rejects')
const got = require('got')
const mikealRequest = require('request')
const { test } = require('tap')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_header_matching.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 4,9 @@ const http = require('http')
const domain = require('domain')
const assertRejects = require('assert-rejects')
const { test } = require('tap')
const got = require('got')
const mikealRequest = require('request')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_intercept.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 10,8 @@ const needle = require('needle')
const restify = require('restify-clients')
const assertRejects = require('assert-rejects')
const hyperquest = require('hyperquest')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_logging.js
Original file line number Diff line number Diff line change
@@ -1,10 1,10 @@
'use strict'

const debug = require('debug')
const got = require('got')
const sinon = require('sinon')
const { test } = require('tap')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_net_connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 2,10 @@

const assert = require('assert')
const http = require('http')
const got = require('got')
const mikealRequest = require('request')
const { test } = require('tap')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_nock_lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 3,8 @@
const http = require('http')
const url = require('url')
const { test } = require('tap')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_persist_optionally.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 6,9 @@
const http = require('http')
const path = require('path')
const assertRejects = require('assert-rejects')
const got = require('got')
const { test } = require('tap')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 5,10 @@ const http = require('http')
const https = require('https')
const fs = require('fs')
const zlib = require('zlib')
const got = require('got')
const mikealRequest = require('request')
const superagent = require('superagent')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_redirects.js
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
'use strict'

const { test } = require('tap')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_remove_interceptor.js
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
'use strict'

const { test } = require('tap')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_reply_body.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 3,8 @@
// Tests for the body argument passed to `.reply()`.

const { test } = require('tap')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_reply_function_async.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 6,8 @@

const http = require('http')
const { test } = require('tap')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_reply_function_sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 7,8 @@
const http = require('http')
const assertRejects = require('assert-rejects')
const { test } = require('tap')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_reply_headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 5,9 @@

const { test } = require('tap')
const mikealRequest = require('request')
const got = require('got')
const lolex = require('lolex')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_reply_with_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 4,9 @@

const path = require('path')
const { test } = require('tap')
const got = require('got')
const proxyquire = require('proxyquire').noPreserveCache()
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 6,8 @@ const path = require('path')
const stream = require('stream')
const util = require('util')
const { test } = require('tap')
const got = require('got')
const nock = require('..')
const got = require('./got_client')

require('./cleanup_after_each')()

Expand Down