MCPcopy Create free account
hub / github.com/commander-cli/commander / createTestCommand

Function createTestCommand

cmd/commander/commander.go:46–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46func createTestCommand() cli.Command {
47 return cli.Command{
48 Name: "test",
49 Usage: "Execute cli app tests",
50 UsageText: `Execute cli app tests
51
52By default it will use the commander.yaml from your current directory.
53Tests are always executed in alphabetical order.
54
55Examples:
56
57Directory test:
58commander test --dir /your/dir/
59
60Stdin test:
61cat commander.yaml | commander test -
62
63HTTP test:
64commander test https://your-url/commander_test.yaml
65
66Filtering tests:
67commander test commander.yaml --filter="my test"
68
69Multiple filters:
70commander test commander.yaml --filter=filter1 --filter=filter2
71
72Regex filters:
73commander test commander.yaml --filter="^filter1$"
74`,
75 ArgsUsage: "[file] [--filter]",
76 Flags: []cli.Flag{
77 cli.BoolFlag{
78 Name: "no-color",
79 EnvVar: "COMMANDER_NO_COLOR",
80 Usage: "Activate or deactivate colored output",
81 },
82 cli.BoolFlag{
83 Name: "verbose",
84 Usage: "More output for debugging",
85 EnvVar: "COMMANDER_VERBOSE",
86 },
87 cli.BoolFlag{
88 Name: "dir",
89 Usage: "Execute all test files in a directory sorted by file name, this is not recursive - e.g. /path/to/test_files/",
90 },
91 cli.StringFlag{
92 Name: "workdir",
93 Usage: "Set the working directory of commander's execution",
94 },
95 cli.StringFlag{
96 Name: "config",
97 Usage: "Default config file to be applied to all test files. Lowest level config values take precednce",
98 },
99 cli.StringSliceFlag{
100 Name: "filter",
101 Usage: `Filter tests by a given regex pattern. Tests are filtered by its title.`,
102 },
103 },

Callers 1

createCliAppFunction · 0.85

Calls 2

TestCommandFunction · 0.92
NewTestContextFromCliFunction · 0.92

Tested by

no test coverage detected