MCPcopy
hub / github.com/urfave/cli / TestJSONExportCommand

Function TestJSONExportCommand

command_test.go:5340–5887  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5338}
5339
5340func TestJSONExportCommand(t *testing.T) {
5341 cmd := buildExtendedTestCommand()
5342 cmd.Arguments = []Argument{
5343 &IntArgs{
5344 Name: "fooi",
5345 },
5346 }
5347
5348 out, err := json.Marshal(cmd)
5349 require.NoError(t, err)
5350
5351 expected := `{
5352 "name": "greet",
5353 "aliases": null,
5354 "usage": "Some app",
5355 "usageText": "app [first_arg] [second_arg]",
5356 "argsUsage": "",
5357 "version": "",
5358 "description": "Description of the application.",
5359 "defaultCommand": "",
5360 "category": "",
5361 "commands": [
5362 {
5363 "name": "config",
5364 "aliases": [
5365 "c"
5366 ],
5367 "usage": "another usage test",
5368 "usageText": "",
5369 "argsUsage": "",
5370 "version": "",
5371 "description": "",
5372 "defaultCommand": "",
5373 "category": "",
5374 "commands": [
5375 {
5376 "name": "sub-config",
5377 "aliases": [
5378 "s",
5379 "ss"
5380 ],
5381 "usage": "another usage test",
5382 "usageText": "",
5383 "argsUsage": "",
5384 "version": "",
5385 "description": "",
5386 "defaultCommand": "",
5387 "category": "",
5388 "commands": null,
5389 "flags": [
5390 {
5391 "name": "sub-flag",
5392 "category": "",
5393 "defaultText": "",
5394 "usage": "",
5395 "required": false,
5396 "hidden": false,
5397 "hideDefault": false,

Callers

nothing calls this directly

Calls 1

buildExtendedTestCommandFunction · 0.85

Tested by

no test coverage detected