(t *testing.T)
| 312 | } |
| 313 | |
| 314 | func TestGenerateRuntimeSetupSteps(t *testing.T) { |
| 315 | tests := []struct { |
| 316 | name string |
| 317 | requirements []RuntimeRequirement |
| 318 | expectSteps int |
| 319 | checkContent []string |
| 320 | }{ |
| 321 | { |
| 322 | name: "generates bun setup", |
| 323 | requirements: []RuntimeRequirement{ |
| 324 | {Runtime: findRuntimeByID("bun"), Version: "1.1"}, |
| 325 | }, |
| 326 | expectSteps: 1, |
| 327 | checkContent: []string{ |
| 328 | "Setup Bun", |
| 329 | "oven-sh/setup-bun@", |
| 330 | "bun-version: '1.1'", |
| 331 | }, |
| 332 | }, |
| 333 | { |
| 334 | name: "generates node setup", |
| 335 | requirements: []RuntimeRequirement{ |
| 336 | {Runtime: findRuntimeByID("node"), Version: "20"}, |
| 337 | }, |
| 338 | expectSteps: 1, |
| 339 | checkContent: []string{ |
| 340 | "Setup Node.js", |
| 341 | "actions/setup-node@", |
| 342 | "node-version: '20'", |
| 343 | }, |
| 344 | }, |
| 345 | { |
| 346 | name: "generates python setup", |
| 347 | requirements: []RuntimeRequirement{ |
| 348 | {Runtime: findRuntimeByID("python"), Version: "3.11"}, |
| 349 | }, |
| 350 | expectSteps: 1, |
| 351 | checkContent: []string{ |
| 352 | "Setup Python", |
| 353 | "actions/setup-python@", |
| 354 | "python-version: '3.11'", |
| 355 | }, |
| 356 | }, |
| 357 | { |
| 358 | name: "generates uv setup", |
| 359 | requirements: []RuntimeRequirement{ |
| 360 | {Runtime: findRuntimeByID("uv"), Version: ""}, |
| 361 | }, |
| 362 | expectSteps: 1, |
| 363 | checkContent: []string{ |
| 364 | "Setup uv", |
| 365 | "astral-sh/setup-uv@", |
| 366 | }, |
| 367 | }, |
| 368 | { |
| 369 | name: "generates dotnet setup", |
| 370 | requirements: []RuntimeRequirement{ |
| 371 | {Runtime: findRuntimeByID("dotnet"), Version: "8.0"}, |
nothing calls this directly
no test coverage detected