pytagora v0.0.228
- Install Pytagora globally by running
npm install pytagora
Integrate Pytagora by adding the Express app and mongoose instance to
global.Pytagora
right after you initialize express/mongoose. Eg. if you initialize Express withlet app = express();
than add this on the next line:``` if (global.Pytagora) global.Pytagora.setApp(app);
<br><br> <h1>Capturing requests</h1>
From the root directory run Pytagora in a capture mode first to capture test data and mocks.
npx pytagora --mode capture --initScript <path to the file you use to start the server>
Eg. if you start the server with
node server.js
than the command would be:npx pytagora --mode capture --initScript server.js
Click around your application or make requests to your API. Pytagora will capture all requests and responses.
Run Pytagora in a test mode to run the tests.
``` pytagora --mode test --script <path to the file you use to start the server> ```
By default, Pytagora will show you basic code coverage report in the console. If you want to generate a more detailed report, you can do so by running Pytagora with --full-code-coverage-report
flag or if you don't want any code coverage displayed, run Pytagora with --no-code-coverage
.
When you run Pytagora with --full-code-coverage-report
flag, it will generate a code_coverage_report
directory in the pytagora_data
directory in the root of your project. Inside that directory you will find lcov-report/index.html
file that you can open in your browser to see the code coverage report.
node RunPytagoraTests.js
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago