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.
$ 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 --yesCreated test team/no-print created /tmp/project/rule-tests/team/no-print-test.ymlxpd new test [OPTIONS] [ID]Arguments
Section titled “Arguments”<ID>
The rule's id or public id.
Options
Section titled “Options”--directory
Section titled “--directory”--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
Section titled “--format”--format <FORMAT>
Print the result as text, or as JSON with createdFiles and modifiedFiles.
Default: text.
Values: text, json.