-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: test mode #123
feat: test mode #123
Conversation
tests/cli.test.sh
Outdated
export SCAFFOLD_OUT="gen" | ||
export SCAFFOLD_DIR=".scaffold,.examples" | ||
|
||
go run main.go new --test cli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need more than one test case. Let's say this example had a couple of "features". Then I would need to run new
to scaffold out several entries in the matrix like {featureA, featureB, featureA+B}
to have test coverage for mistakes in the scaffold that can only be observed when those features interact in the generated app, as well as verify each feature works in isolation.
So maybe the yaml provides named test cases? Then I would reference the names here like --test=case1
?
@alexeagle, took another stab with a different API.
tests:
default:
Var1: val1
Var2: val2
test2:
Var1: val1
Var2: val2
Example AST Output scaffold test --log-level="panic" --case="default" --memfs --ast <scaffold-name>
scaffold-test-3811: (type=dir)
main.go: (type=file)
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello, World!")
} |
Neat! Thanks :) An idea for generalizing just a bit: Since the Personally I wouldn't add a new
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! excited to try this out :)
I'm pretty happy with how the API turned out. Going to write some better documentation and write a few more tests this weekend so hopefully it'll be merged and released by Monday. Thanks for all your feedback, it was very helpful! |
No description provided.