How to use nockBack?
See original GitHub issueWhat am I missing here?
[~/tmp]$ cat test.js
const Wreck = require('wreck');
const nock = require('nock');
const nockBack = nock.back;
nock.enableNetConnect();
nock.enableNetConnect(/canihaz/);
nockBack.fixtures = './tmp';
nockBack.setMode('record');
Wreck.get('https://canihazip.com/s', (err, res, body) => {
var p = require('purdy');
p(err);
p(res);
p(body);
});
[~/tmp]$ node test.js
NetConnectNotAllowedError {
name: 'NetConnectNotAllowedError',
code: 'ENETUNREACH',
message: 'Client request error: Nock: Not allow net connect for "canihazip.com:443/s"',
trace: [
[0] {
method: 'GET',
url: 'https://canihazip.com/s'
}
],
isBoom: true,
isServer: true,
data: null,
output: {
statusCode: 502,
payload: {
message: 'Client request error: Nock: Not allow net connect for "canihazip.com:443/s"',
statusCode: 502,
error: 'Bad Gateway'
},
headers: {}
},
reformat: [Function]
}
undefined
undefined
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Knockback in Minecraft - DigMinecraft
You can add the Knockback enchantment to any sword using an enchanting table, anvil, or game command. Then use the enchanted sword to...
Read more >Knockback - Minecraft Wiki - Fandom
Knockback is an enchantment to a sword that increases the sword's knockback.
Read more >How to use knockback influence in MultiVersus - Polygon
WB's character brawler MultiVersus has a technique called knockback influence. Here's how to use it — and how to clear the glitchy in-game ......
Read more >How the Knockback enchantment works in Minecraft
Knockback can be placed on any sword by using an enchanting table, expending experience earned by the player and some lapis lazuli. Higher-level ......
Read more >Knock back Definition & Meaning - Merriam-Webster
The meaning of KNOCK BACK is drink, swallow; specifically : to toss down (an alcoholic beverage).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Move
nock.enableNetConnect();
below the nockBack fixtures and setMode lines. Then it should work. There’s also no need for multipleenableNetConnect
- the first is permissive of all netConnects, and the second just limits it, so just go with one or the other.Let me know if this works for you!
I never had a chance to get back to this but in my example here, I don’t see anything actually being recorded in
./tmp
. Am I missing something else too?