test: add upgrade tests (#1126)

This commit is contained in:
Jonas Plum
2025-02-02 13:40:33 +01:00
committed by GitHub
parent b31f90c3ea
commit 7de89a752c
9 changed files with 411 additions and 44 deletions

View File

@@ -33,6 +33,7 @@ func App(dir string, test bool) (*pocketbase.PocketBase, error) {
_ = app.RootCmd.ParseFlags(os.Args[1:])
app.RootCmd.AddCommand(fakeDataCmd(app))
app.RootCmd.AddCommand(defaultDataCmd(app))
webhook.BindHooks(app)
reaction.BindHooks(app, test)

View File

@@ -23,3 +23,14 @@ func fakeDataCmd(app core.App) *cobra.Command {
return cmd
}
func defaultDataCmd(app core.App) *cobra.Command {
cmd := &cobra.Command{
Use: "default-data",
RunE: func(_ *cobra.Command, _ []string) error {
return fakedata.GenerateDefaultData(app)
},
}
return cmd
}