1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-07-17 11:07:42 +02:00

[#1267] call app.Bootstrap() before cobra commands execution

This commit is contained in:
Gani Georgiev
2022-12-15 23:20:23 +02:00
parent 8e582acbee
commit c25e67e13d
6 changed files with 189 additions and 20 deletions

View File

@ -53,11 +53,19 @@ func TestBaseAppBootstrap(t *testing.T) {
})
defer app.ResetBootstrapState()
if app.IsBootstrapped() {
t.Fatal("Didn't expect the application to be bootstrapped.")
}
// bootstrap
if err := app.Bootstrap(); err != nil {
t.Fatal(err)
}
if !app.IsBootstrapped() {
t.Fatal("Expected the application to be bootstrapped.")
}
if stat, err := os.Stat(testDataDir); err != nil || !stat.IsDir() {
t.Fatal("Expected test data directory to be created.")
}