Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix smoke test substitution #51494

Merged
merged 3 commits into from
Nov 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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