node-clinic icon indicating copy to clipboard operation
node-clinic copied to clipboard

Tests profiling support

Open 0xorial opened this issue 2 years ago • 4 comments

I have a test suite (using mocha) which I want to profile. Is this use case supported? If I run clinic flame -- node ./node_modules/mocha/bin/mocha.js, only thing I get in the output is the instruction of how to call clinic flame and nothing seems to happen. (Running on Windows)

0xorial avatar Jul 15 '22 10:07 0xorial

Could you create a reproducible code? Reference: https://stackoverflow.com/help/minimal-reproducible-example.

RafaelGSS avatar Jul 15 '22 12:07 RafaelGSS

https://github.com/0xorial/mocha-clinic-test

0xorial avatar Jul 19 '22 17:07 0xorial

Thanks, @0xorial I'll look at it soon as I have time

RafaelGSS avatar Jul 21 '22 12:07 RafaelGSS

I gave it a shot today and it seems working fine

rafaelgss@rafaelgss-desktop:~/repos/os/tests/mocha-clinic-test$ clinic flame -- node ./node_modules/.bin/mocha test/index.test.js
To generate the report press: Ctrl + C


  Array
    #indexOf()
      ✔ should return -1 when the value is not present (3291ms)


  1 passing (3s)

Analysing data
Generated HTML file is file:///home/rafaelgss/repos/os/tests/mocha-clinic-test/.clinic/25973.clinic-flame.html

Could you re-install and run it again? If that doesn't work, it might be related to your environment (windows).

RafaelGSS avatar Jul 23 '22 17:07 RafaelGSS