neiam /action-setup-beam
action-setup-beam
public · Issues · Pulls · Labels · Forks · Compare · Actions queued
⭐
Log in to mark this repository.
Test rebar3 being installed after OTP via .tool-versions (#180)
0499627 · Paulo F. Oliveira · 2023-01-28 03:57
Files changed
modified
__tests__/setup-beam.test.js
+22
−1
@@ -412,13 +412,19 @@ async function testGetVersionFromSpec() {
| 412 | 412 | async function testParseVersionFile() { |
| 413 | 413 | const otpVersion = unsimulateInput('otp-version') |
| 414 | 414 | const elixirVersion = unsimulateInput('elixir-version') |
| 415 | + const gleamVersion = unsimulateInput('gleam-version') | |
| 416 | + const rebar3Version = unsimulateInput('rebar3-version') | |
| 415 | 417 | |
| 416 | 418 | const erlang = '25.1.1' |
| 417 | 419 | const elixir = '1.14.1' |
| 420 | + const gleam = '0.23.0' | |
| 421 | + const rebar3 = '3.16.0' | |
| 418 | 422 | const toolVersions = `# a comment |
| 419 | 423 | erlang ${erlang}# comment, no space |
| 420 | 424 | elixir ${elixir} # comment, with space |
| 421 | − gleam 0.23 # not picked up` | |
| 425 | + not-gleam 0.23 # not picked up | |
| 426 | +gleam ${gleam} | |
| 427 | +rebar ${rebar3}` | |
| 422 | 428 | const filename = '__tests__/.tool-versions' |
| 423 | 429 | fs.writeFileSync(filename, toolVersions) |
| 424 | 430 | process.env.GITHUB_WORKSPACE = '' |
@@ -426,8 +432,23 @@ elixir ${elixir} # comment, with space
| 426 | 432 | assert.strictEqual(appVersions.get('erlang'), erlang) |
| 427 | 433 | assert.strictEqual(appVersions.get('elixir'), elixir) |
| 428 | 434 | |
| 435 | + assert.ok(async () => { | |
| 436 | + await installer.installOTP(erlang) | |
| 437 | + }) | |
| 438 | + assert.ok(async () => { | |
| 439 | + await installer.installElixir(elixir) | |
| 440 | + }) | |
| 441 | + assert.ok(async () => { | |
| 442 | + await installer.installGleam(gleam) | |
| 443 | + }) | |
| 444 | + assert.ok(async () => { | |
| 445 | + await installer.installRebar3(rebar3) | |
| 446 | + }) | |
| 447 | + | |
| 429 | 448 | simulateInput('otp-version', otpVersion) |
| 430 | 449 | simulateInput('elixir-version', elixirVersion) |
| 450 | + simulateInput('gleam-version', gleamVersion) | |
| 451 | + simulateInput('rebar3-version', rebar3Version) | |
| 431 | 452 | } |
| 432 | 453 | |
| 433 | 454 | function unsimulateInput(key) { |
Parents: 1f06ac3