Skip to content

Commit

Permalink
test: Add todo test for conflict between hostnames (#1109)
Browse files Browse the repository at this point in the history
Ref #1108
  • Loading branch information
coleturner authored and paulmelnikow committed Aug 22, 2019
1 parent 057bbdf commit 949d264
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions tests/test_intercept.js
Expand Up @@ -1047,7 +1047,8 @@ test('match domain using regexp', t => {
})
})

test('match domain using regexp with path as callback (issue-1137)', t => {
// https://github.com/nock/nock/issues/1137
test('match domain using regexp with path as callback', t => {
nock(/.*/)
.get(() => true)
.reply(200, 'Match regex')
Expand All @@ -1060,7 +1061,8 @@ test('match domain using regexp with path as callback (issue-1137)', t => {
})
})

test('match multiple interceptors with regexp domain (issue-508)', t => {
// https://github.com/nock/nock/issues/508
test('match multiple interceptors with regexp domain', t => {
nock(/chainregex/)
.get('/')
.reply(200, 'Match regex')
Expand All @@ -1082,6 +1084,29 @@ test('match multiple interceptors with regexp domain (issue-508)', t => {
})
})

// FIXME: This marked as { todo: true } because it is an existing bug.
// https://github.com/nock/nock/issues/1108
test(
'match hostname as regex and string in tandem',
{ todo: true },
async t => {
const scope1 = nock(/.*/)
.get('/hello/world')
.reply()
const scope2 = nock('http://example.test')
.get('/hello/planet')
.reply()

const response1 = await got('http://example.test/hello/world')
t.is(response1.statusCode, 200)
scope1.done()

const response2 = await got('http://example.test/hello/planet')
t.is(response2.statusCode, 200)
scope2.done()
}
)

test('match domain using intercept callback', t => {
const validUrl = ['/cats', '/dogs']

Expand Down

0 comments on commit 949d264

Please sign in to comment.