Skip to content

Commit

Permalink
fix: update tests to the new default endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
  • Loading branch information
leodido committed Feb 9, 2023
1 parent a10ebcb commit 807cfc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/root/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (suite *CmdAdditionalHelpSuite) SetupSuite() {
b += "In this file you can set the values for the global `lstn` configurations.\n"
b += "Anyways, notice that environment variables, and flags (if any) override the values in your configuration file.\n\n"
b += "Here's an example of a configuration file (with the default values):\n\n"
b += "```yaml\nendpoint: http://127.0.0.1:3000\nloglevel: info\ntimeout: 60\n```\n"
b += "```yaml\nendpoint: https://npm.listen.dev\nloglevel: info\ntimeout: 60\n```\n"
suite.expectedOuts[Config] = b

b = "# lstn environment variables\n\n"
Expand All @@ -63,7 +63,7 @@ func (suite *CmdAdditionalHelpSuite) SetupSuite() {
b += "`LSTN_TIMEOUT`: timeout in seconds\n\n"
suite.expectedOuts[Environment] = b

suite.expectedOuts[Manual] = "# lstn cheatsheet\n\n## Global Flags\n\nEvery child command inherits the following flags:\n\n```\n--config string config file (default is $HOME/.lstn.yaml)\n--endpoint string the listen.dev endpoint emitting the verdicts (default \"http://127.0.0.1:3000\")\n--loglevel string log level (default \"info\")\n--timeout int timeout in seconds (default 60)\n```\n\n## `lstn completion`\n\nGenerate the autocompletion script for the specified shell.\n\n### `lstn completion bash`\n\nGenerate the autocompletion script for bash.\n\n```\n--no-descriptions disable completion descriptions\n```\n\n### `lstn completion fish [flags]`\n\nGenerate the autocompletion script for fish.\n\n```\n--no-descriptions disable completion descriptions\n```\n\n### `lstn completion powershell [flags]`\n\nGenerate the autocompletion script for powershell.\n\n```\n--no-descriptions disable completion descriptions\n```\n\n### `lstn completion zsh [flags]`\n\nGenerate the autocompletion script for zsh.\n\n```\n--no-descriptions disable completion descriptions\n```\n\n## `lstn config`\n\nDetails about the ~/.lstn.yaml config file.\n\n```\n-h, --help help for config\n```\n\n## `lstn environment`\n\nWhich environment variables you can use with lstn.\n\n```\n-h, --help help for environment\n```\n\n## `lstn exit`\n\nDetails about the lstn exit codes.\n\n## `lstn help [command]`\n\nHelp about any command.\n\n## `lstn in <path>`\n\nInspect the verdicts of your dependencies.\n\n```\n-q, --jq string filter the output using a jq expression\n --json output the verdicts (if any) in JSON form\n```\n\nFor example:\n\n```bash\nlstn in\nlstn in .\nlstn in /we/snitch\nlstn in sub/dir\n```\n\n## `lstn manual`\n\nA comprehensive reference of all the lstn commands.\n\n```\n-h, --help help for manual\n```\n\n## `lstn to <name> [version] [shasum]`\n\nGet the verdicts of a package.\n\n```\n-q, --jq string filter the output using a jq expression\n --json output the verdicts (if any) in JSON form\n```\n\nFor example:\n\n```bash\nlstn to chalk\nlstn to debug 4.3.4\n```\n\n## `lstn version`\n\nPrint out version information.\n\n"
suite.expectedOuts[Manual] = "# lstn cheatsheet\n\n## Global Flags\n\nEvery child command inherits the following flags:\n\n```\n--config string config file (default is $HOME/.lstn.yaml)\n--endpoint string the listen.dev endpoint emitting the verdicts (default \"https://npm.listen.dev\")\n--loglevel string log level (default \"info\")\n--timeout int timeout in seconds (default 60)\n```\n\n## `lstn completion`\n\nGenerate the autocompletion script for the specified shell.\n\n### `lstn completion bash`\n\nGenerate the autocompletion script for bash.\n\n```\n--no-descriptions disable completion descriptions\n```\n\n### `lstn completion fish [flags]`\n\nGenerate the autocompletion script for fish.\n\n```\n--no-descriptions disable completion descriptions\n```\n\n### `lstn completion powershell [flags]`\n\nGenerate the autocompletion script for powershell.\n\n```\n--no-descriptions disable completion descriptions\n```\n\n### `lstn completion zsh [flags]`\n\nGenerate the autocompletion script for zsh.\n\n```\n--no-descriptions disable completion descriptions\n```\n\n## `lstn config`\n\nDetails about the ~/.lstn.yaml config file.\n\n```\n-h, --help help for config\n```\n\n## `lstn environment`\n\nWhich environment variables you can use with lstn.\n\n```\n-h, --help help for environment\n```\n\n## `lstn exit`\n\nDetails about the lstn exit codes.\n\n## `lstn help [command]`\n\nHelp about any command.\n\n## `lstn in <path>`\n\nInspect the verdicts of your dependencies.\n\n```\n-q, --jq string filter the output using a jq expression\n --json output the verdicts (if any) in JSON form\n```\n\nFor example:\n\n```bash\nlstn in\nlstn in .\nlstn in /we/snitch\nlstn in sub/dir\n```\n\n## `lstn manual`\n\nA comprehensive reference of all the lstn commands.\n\n```\n-h, --help help for manual\n```\n\n## `lstn to <name> [version] [shasum]`\n\nGet the verdicts of a package.\n\n```\n-q, --jq string filter the output using a jq expression\n --json output the verdicts (if any) in JSON form\n```\n\nFor example:\n\n```bash\nlstn to chalk\nlstn to debug 4.3.4\n```\n\n## `lstn version`\n\nPrint out version information.\n\n"

b = "The lstn CLI follows the usual conventions regarding exit codes.\n\n"
b += "Meaning:\n\n"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/flags/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (suite *FlagsConfigSuite) TestGetConfigFlagsDefaults() {
assert.Equal(suite.T(), 3, len(m))

expected := make(map[string]string)
expected["endpoint"] = "http://127.0.0.1:3000"
expected["endpoint"] = "https://npm.listen.dev"
expected["loglevel"] = "info"
expected["timeout"] = "60"

Expand Down

0 comments on commit 807cfc9

Please # to comment.