Skip to content

Commit

Permalink
Fix smoke test substitution (#51494)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey authored Nov 12, 2022
1 parent 021fd20 commit b553aff
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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
Expand Down

0 comments on commit b553aff

Please sign in to comment.