| 368 | } |
| 369 | |
| 370 | func TestClient_SessionFSConfig(t *testing.T) { |
| 371 | t.Run("should throw error when InitialWorkingDirectory is missing", func(t *testing.T) { |
| 372 | defer func() { |
| 373 | if r := recover(); r == nil { |
| 374 | t.Error("Expected panic for missing SessionFS.InitialWorkingDirectory") |
| 375 | } else { |
| 376 | matched, _ := regexp.MatchString("SessionFS.InitialWorkingDirectory is required", r.(string)) |
| 377 | if !matched { |
| 378 | t.Errorf("Expected panic message to contain 'SessionFS.InitialWorkingDirectory is required', got: %v", r) |
| 379 | } |
| 380 | } |
| 381 | }() |
| 382 | |
| 383 | NewClient(&ClientOptions{ |
| 384 | SessionFS: &SessionFSConfig{ |
| 385 | SessionStatePath: "/session-state", |
| 386 | Conventions: rpc.SessionFSSetProviderConventionsPosix, |
| 387 | }, |
| 388 | }) |
| 389 | }) |
| 390 | |
| 391 | t.Run("should throw error when SessionStatePath is missing", func(t *testing.T) { |
| 392 | defer func() { |
| 393 | if r := recover(); r == nil { |
| 394 | t.Error("Expected panic for missing SessionFS.SessionStatePath") |
| 395 | } else { |
| 396 | matched, _ := regexp.MatchString("SessionFS.SessionStatePath is required", r.(string)) |
| 397 | if !matched { |
| 398 | t.Errorf("Expected panic message to contain 'SessionFS.SessionStatePath is required', got: %v", r) |
| 399 | } |
| 400 | } |
| 401 | }() |
| 402 | |
| 403 | NewClient(&ClientOptions{ |
| 404 | SessionFS: &SessionFSConfig{ |
| 405 | InitialWorkingDirectory: "/", |
| 406 | Conventions: rpc.SessionFSSetProviderConventionsPosix, |
| 407 | }, |
| 408 | }) |
| 409 | }) |
| 410 | } |
| 411 | |
| 412 | func TestClient_AuthOptions(t *testing.T) { |
| 413 | t.Run("should accept GitHubToken option", func(t *testing.T) { |