question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What takes precendence, a fixture or an inline code nock?

See original GitHub issue

Assume I have the following:

nockBack('scbe.json', (nockDone) => {
  describe.only('Check Health of the Service', function () {
    
    after(() => {
      nockDone();
    });
    
    this.timeout(config.timeouts.test);
    
    before('Setup nocks', () => {
      device = new Device();
      nock(shadows).persist().get('/v2/health').reply(200, {message: 'healthy'});
   });

});

now, in scbe.json I have the recording of this call already:

    {
        "scope": "http://shadows-v2:8031",
        "method": "GET",
        "path": "/shadows/v2/health",
        "body": "",
        "status": 401,
        "response": [
            "1f8b0800000000000003",
            "ab56ca4d2d2e4e4c4f55b252ca484dcc29c9a854aa0500c7f0ce0015000000"
        ],
        "rawHeaders": [
            "connection",
            "close",
            "content-type",
            "application/json; charset=utf-8",
            "cache-control",
            "no-cache",
            "vary",
            "accept-encoding",
            "content-encoding",
            "gzip",
            "Date",
            "Mon, 06 Aug 2018 13:12:27 GMT",
            "Transfer-Encoding",
            "chunked"
        ]
    },

is it gonna be 200 , or 401, when I run this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
gkatsanoscommented, Aug 17, 2018

I’m sorry, I’ve missed that bit in your code, yeah, it should work then 😃

And in that case I don’t know what takes precendence, but when you find out I’d appreciate if you could send a pull request to update the README 🙏

Will do ! I will keep this open as a placeholder/reminder for myself

1reaction
gkatsanoscommented, Nov 21, 2018

Another team took over the project but I think they went for mockery.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Insert a Code Block or Inline Code into a Medium Article
For inline code blocks in a paragraph on Medium, type a single backtick (`) to begin and end your code. Or highlight a...
Read more >
Escaping Markdown Code Snippets and Inline Code as ...
The inline code block renders as a <code></code> in Html. But what happens if you need to have a ` in your escaped...
Read more >
The Inline Code element - HTML: HyperText Markup Language
Preferences set by the user might take precedence over the specified CSS. Technical summary. Content categories · Flow content, phrasing content ...
Read more >
<code> vs <pre> vs <samp> for inline and block code snippets
The pre element represents a block of preformatted text, in which structure is represented by typographic conventions rather than by elements. Some examples...
Read more >
API Reference — pytest documentation
Fixtures can provide their values to test functions using return or yield statements. When using yield the code block after the yield statement...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found