import assert from "node:assert";
import { describe, test } from "node:test";
import { TSConfigUpgrader } from "../common/upgraders/tsconfig-upgrader.js";
process.env.ZUPLO_OVERRIDE_CI_TO_TEST = "true";
describe("TSConfigUpgrader checks", async function () {
    test("Should not run for a valid tsconfig.json", async function () {
        const upgrader = new TSConfigUpgrader(new URL("../../test-fixtures-cli/tsconfig/valid", import.meta.url)
            .pathname);
        const needsUpgrade = await upgrader.needsUpgrade();
        assert.equal(needsUpgrade, false);
    });
    test("Should run for a legacy tsconfig.json", async function () {
        const upgrader = new TSConfigUpgrader(new URL("../../test-fixtures-cli/tsconfig/legacy", import.meta.url)
            .pathname);
        const needsUpgrade = await upgrader.needsUpgrade();
        assert.equal(needsUpgrade, true);
    });
    test("Should run for a missing prop tsconfig.json", async function () {
        const upgrader = new TSConfigUpgrader(new URL("../../test-fixtures-cli/tsconfig/missing-prop", import.meta.url)
            .pathname);
        const needsUpgrade = await upgrader.needsUpgrade();
        assert.equal(needsUpgrade, true);
    });
    test("Should run when baseUrl set in tsconfig.json", async function () {
        const upgrader = new TSConfigUpgrader(new URL("../../test-fixtures-cli/tsconfig/missing-prop", import.meta.url)
            .pathname);
        const needsUpgrade = await upgrader.needsUpgrade();
        assert.equal(needsUpgrade, true);
    });
});
//# sourceMappingURL=tsconfig-upgrader.test.js.map