mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
* feat(cli): add golden tests for errors (#11588) Creates golden files from `coder/cli/errors.go`. Adds a unit test to test against golden files. Adds a make file command to regenerate golden files. Abstracts test against golden files.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
Encountered an error running "coder exp example-error api", see "coder exp example-error api --help" for more information
|
||||
error: Top level sdk error message.
|
||||
Have you tried turning it off and on again?
|
||||
@@ -0,0 +1,2 @@
|
||||
Encountered an error running "coder exp example-error arg-required", see "coder exp example-error arg-required --help" for more information
|
||||
error: wanted 1 args but got 0 []
|
||||
@@ -0,0 +1,2 @@
|
||||
Encountered an error running "coder exp example-error cmd", see "coder exp example-error cmd --help" for more information
|
||||
error: some error: function decided not to work, and it never will
|
||||
@@ -0,0 +1,7 @@
|
||||
Encountered an error running "coder exp example-error multi-error", see "coder exp example-error multi-error --help" for more information
|
||||
error: 3 errors encountered: Trace=[wrapped: ])
|
||||
1. first error: function decided not to work, and it never will
|
||||
2. second error: function decided not to work, and it never will
|
||||
3. Trace=[wrapped api error: ]
|
||||
Top level sdk error message.
|
||||
magic dust unavailable, please try again later
|
||||
@@ -0,0 +1,6 @@
|
||||
Encountered an error running "coder exp example-error multi-multi-error", see "coder exp example-error multi-multi-error --help" for more information
|
||||
error: 2 errors encountered:
|
||||
1. parent error: function decided not to work, and it never will
|
||||
2. 2 errors encountered:
|
||||
1. child first error: function decided not to work, and it never will
|
||||
2. child second error: function decided not to work, and it never will
|
||||
@@ -0,0 +1 @@
|
||||
Missing values for the required flags: magic-word
|
||||
Reference in New Issue
Block a user