Stop saving config in initConfig()

This commit is contained in:
Chuan-kai Lin
2025-09-11 12:31:29 -07:00
parent 4e2e64a92a
commit 5c30ae46c1
4 changed files with 9 additions and 10 deletions

View File

@@ -229,7 +229,7 @@ test("load code quality config", async (t) => {
});
});
test("loading config saves config", async (t) => {
test("loading a saved config produces the same config", async (t) => {
return await withTmpDir(async (tempDir) => {
const logger = getRunnerLogger(true);
@@ -259,6 +259,7 @@ test("loading config saves config", async (t) => {
logger,
}),
);
await configUtils.saveConfig(config1, logger);
// The saved config file should now exist
t.true(fs.existsSync(configUtils.getPathToParsedConfigFile(tempDir)));
@@ -300,7 +301,7 @@ test("loading config with version mismatch throws", async (t) => {
.stub(actionsUtil, "getActionVersion")
.returns("does-not-exist");
await configUtils.initConfig(
const config = await configUtils.initConfig(
createTestInitConfigInputs({
languagesInput: "javascript,python",
tempDir,
@@ -309,6 +310,8 @@ test("loading config with version mismatch throws", async (t) => {
logger,
}),
);
// initConfig does not save the config, so we do it here.
await configUtils.saveConfig(config, logger);
// Restore `getActionVersion`.
getActionVersionStub.restore();