Build TypeScript with the installed node and name no Node version (issue 1572, ADR 0477)

This commit is contained in:
2026-10-21 08:04:41 +00:00
parent fc4089cde9
commit edec7063b3
6 changed files with 61 additions and 53 deletions
@@ -2,6 +2,7 @@ package main
import (
"context"
"errors"
"os"
"path/filepath"
"strings"
@@ -57,7 +58,7 @@ func toolchainIn(t *testing.T, fake *fakeNpm) Toolchain {
func TestAMissingToolchainDirectoryIsInstalledOnceFromTheLock(t *testing.T) {
fake := &fakeNpm{}
tc := toolchainIn(t, fake)
version := Recipe{Steps: "1", Node: "v26.10.0", Lock: "x"}.Version()
version := Recipe{Steps: "1", Lock: "x"}.Version()
dir := filepath.Join(tc.Paths.Cache, "toolchain", version)
if tc.Present(version) {
t.Fatal("present before any install")
@@ -137,7 +138,8 @@ func TestPrepareInstallsOnlyBehindAPassingGuard(t *testing.T) {
fake := &fakeNpm{}
tc := toolchainIn(t, fake)
states := newStates()
m := moduleWith(states, "v26.11.0")
m := moduleWith(states, "")
m.Probe = func(context.Context) (string, error) { return "", errors.New("no node") }
m.Toolchain = &tc
if err := m.Prepare(context.Background()); err == nil || len(fake.calls) != 0 {
t.Fatalf("a refusing node: %v, %d npm calls", err, len(fake.calls))