Skip to content

Currently supported command line options

openHawkes edited this page Jun 9, 2023 · 1 revision

Supported options

  • Legacy Chutzpah options
    • "walk up commands" (see below)
      • /openInBrowser
        • see Using with VS Code for in-depth description of support.
        • Currently also creates a coverage report, but opens up the Jasmine standalone test page, not coverage.
      • /coverage
        • Right now, the coverage report should be placed in a coverage directory at the same root as your active Chutzpah.json file.
        • Opens the coverage report as a static html file.
        • Discussed in more detail in the Examples section.
    • /coveragehtml {/some/file/name.html}
      • Must be used with /coverage, natch.
      • Minimally supported.
      • Still creates a coverage report at the same root as your Chutzpah.json file.
      • Then copies the index.html file into the name given here.
      • Also copies all the supporting html to the same parent folder as the specified file.
      • Basically the minimum to make the Chutzpah runner work.
  • Nonstandard options
    • The "walk down" commands described below.
      • /findAllSuites
      • /walkAllRunOne
      • /runAllSuites
    • /version -- outputs the version, no less.
    • /runOne -- Will run files

NOTE: There's a sample Chutzpah.json file and testing app in the test folder.


"Walk up commands"

Note that for /openInBrowser or /coverage, both standard Chutzpah.exe commands, khutzpa walks up the folder hierarchy from the path given until it finds a Chutzpah.json. This means your path can be either...

  1. A direct path to the Chutzpah.json file --OR--
  2. Any child folder of a folder that contains a Chutzpah.json file

So instead of this command:

khutzpa /usr/local/lib/node_modules/khutzpa/tests/fakeSite/Chutzpah.json /openInBrowser

... you could likely use this command...

khutzpa /usr/local/lib/node_modules/khutzpa/tests/fakeSites/fakeTests/testSubdir /openInBrowser

... or, for a Windows install, something like...

khutzpa C:\Users\[yourUser]\AppData\Roaming\npm\node_modules\khutzpa\tests\fakeSite\fakeTests\testSubdir /openInBrowser

The first Chutzpah.json found on the "walk up" will be used.


"Walk down commands"

If you have more than one Chutzpah.json file in a folder hierarchy, you can use these new khutzpa-specific commands that walk down a folder hierarchy instead of up and can access multiple Chutzpah.json configuration files in a single run.

  1. Find all Chutzpah.json files with
    • khutzpa /path/to/parent/of/configs /findAllSuites
    • Do this first and see if the files are what you expect.
  2. Find all and run one with
    • khutzpa /path/to/parent/of/configs /walkAllRunOne
    • Then enter the index displayed next to the Chutzpah.json path you want to run & hit return.
  3. Find and run all with
    • khutzpa /path/to/parent/of/configs /runAllSuites
    • Returns 0 if they all return success.
    • Returns first non-zero error code (though continues running all suites) if not.