mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-12 03:20:56 -06:00
Fix smoke test substitution (#51494)
This commit is contained in:
parent
021fd20aac
commit
b553affd5c
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user