(t *testing.T)
| 473 | } |
| 474 | |
| 475 | func TestResolvePathAliasNoMatch(t *testing.T) { |
| 476 | files := []FileInfo{ |
| 477 | {Path: "src/modules/auth/index.ts"}, |
| 478 | } |
| 479 | idx := buildFileIndex(files, "") |
| 480 | |
| 481 | pathAliases := map[string][]string{ |
| 482 | "@modules/*": {"src/modules/*"}, |
| 483 | } |
| 484 | |
| 485 | // Import that doesn't match any alias |
| 486 | result := resolvePathAlias("lodash", pathAliases, ".", idx) |
| 487 | if len(result) != 0 { |
| 488 | t.Errorf("Expected no results for non-alias import, got %v", result) |
| 489 | } |
| 490 | |
| 491 | // Import that matches alias but file doesn't exist |
| 492 | result = resolvePathAlias("@modules/nonexistent", pathAliases, ".", idx) |
| 493 | if len(result) != 0 { |
| 494 | t.Errorf("Expected no results for non-existent file, got %v", result) |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | func TestDepsBuildFileIndex(t *testing.T) { |
| 499 | handlerPath := filepath.FromSlash("pkg/service/handler.go") |
nothing calls this directly
no test coverage detected