From b553affd5cd58df10dae461091efb97b9a829aea Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 11 Nov 2022 16:29:42 -0800 Subject: [PATCH] Fix smoke test substitution (#51494) --- .github/workflows/ci.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 308e803d778..d17e16da6ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,10 +109,14 @@ jobs: npm init --yes npm install $PACKAGE tslib + echo "Testing tsc..." npx tsc --version + + echo "Testing tsserver..." echo '{"seq": 1, "command": "status"}' | npx tsserver - cat > smoke.js << EOF + cat > smoke.js << 'EOF' + console.log(`Testing ${process.argv[2]}...`); const { __importDefault, __importStar } = require("tslib"); const ts = require(process.argv[2]); @@ -132,16 +136,16 @@ jobs: success = !!fn(); } catch {} - if (success !== shouldSucceed) { - if (success) { - console.error(`${fn.toString()} unexpectedly succeeded.`); - } - else { - console.error(`${fn.toString()} did not succeed.`); - } + const status = success ? "succeeded" : "failed"; + if (success === shouldSucceed) { + console.log(`${fn.toString()} ${status} as expected.`); + } + else { + console.log(`${fn.toString()} unexpectedly ${status}.`); process.exitCode = 1; } } + console.log("ok"); EOF node ./smoke.js typescript