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

Docs: Improve developer experience when understanding the code base #30

Closed
Andrei0872 opened this issue Sep 13, 2019 · 1 comment
Closed

Comments

@Andrei0872
Copy link
Contributor

Andrei0872 commented Sep 13, 2019

I think it would be great if there was a section in which we would guide the developer on how to easily understand the code base.

I'm particularly referring to understanding what's going on through using the debugger while running the tests.
I personally saved a lot of time by following the above approach.

These are the steps that I followed in order to really understand the magic behind this API(I'm assuming you're using VS Code):

  1. Open the debugger tab and add a new configuration
  2. In your launch.json, add the following lines:
"configurations": [
        {
             "type": "node",
             "request": "launch",
             "name": "Mocha Tests",
             "program": "${workspaceRoot}/node_modules/mocha/bin/mocha",
             "args": [
               "--inspect-brk",
               "${workspaceFolder}/test/integration/routes/posts.js"
             ],
             "port": 9229,
             "runtimeVersion": "10.12.0",
             "envFile": "${workspaceFolder}/.env.test",
             "internalConsoleOptions": "neverOpen"
       }
    ]

Note: the .env.test file is where you put the environment variables so you don't have to issue them manually

  1. Add these options in your .babelrc file:
"retainLines": true,
 "sourceMaps": "inline"
  1. Open a test file, place a some breakpoints and start running the tests in debugging mode by pressing F5 or clicking on the Start Debugging button.
@idoshamun
Copy link
Member

Hi @Andrei0872,
With the release of the new API, I believe this issue is no longer relevant or might need to be updated.
I'm closing this issue, for the time being, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants