Skip to content

xpd new test

Create an empty test case for a rule, with no valid or invalid code yet Use xpd new test to add an empty test case for a rule, by its id or its public id. It writes no valid or invalid code, so add examples and run xpd test.

Terminal window
$ xpd new project --pack team --yes --format json | jq -c .item
"project"
$ xpd new rule team/no-print --pattern 'print($X)' --message 'Use the project logger.' --yes --format json | jq -c .id
"team/no-print"
$ xpd new test team/no-print --yes
Created test team/no-print
created /tmp/project/rule-tests/team/no-print-test.yml
Terminal window
xpd new test [OPTIONS] [ID]

<ID>

The rule's id or public id.

--directory <DIR>

The project folder, which holds sgconfig.yml. Nothing is written outside it. Default: the nearest folder at or above the current one with sgconfig.yml, or the current folder for a new project.

-y, --yes

Never ask. Fail when a required flag is missing.

--format <FORMAT>

Print the result as text, or as JSON with createdFiles and modifiedFiles.

Default: text.

Values: text, json.