Skip to content

Commit

Permalink
Fix addToStateFile import in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Oksamies committed Feb 5, 2024
1 parent 4d361e4 commit cf001b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/installers/InstallRuleInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async function buildInstallForRuleSubtype(
}


async function addToStateFile(mod: ManifestV2, files: Map<string, string>, profile: Profile) {
export async function addToStateFile(mod: ManifestV2, files: Map<string, string>, profile: Profile) {
await FileUtils.ensureDirectory(path.join(profile.getPathOfProfile(), "_state"));
let existing: Map<string, string> = new Map();
if (await FsProvider.instance.exists(path.join(profile.getPathOfProfile(), "_state", `${mod.getName()}-state.yml`))) {
Expand Down
3 changes: 2 additions & 1 deletion test/jest/__tests__/impl/MelonLoader/state.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import StateTracker from 'src/model/installing/StateTracker';
import GenericProfileInstaller from 'src/r2mm/installing/profile_installers/GenericProfileInstaller';
import GameManager from 'src/model/game/GameManager';
import ConflictManagementProvider from 'src/providers/generic/installing/ConflictManagementProvider';
import { addToStateFile } from '../../../../../src/installers/InstallRuleInstaller';

let sandbox = Sinon.createSandbox();
let mlProfileInstaller: GenericProfileInstaller;
Expand Down Expand Up @@ -51,7 +52,7 @@ describe("State testing", () => {
fsStub.exists.withArgs(path.join(profile.getPathOfProfile(), "_state")).returns(Promise.resolve(true));
fsStub.exists.withArgs(path.join(profile.getPathOfProfile(), "_state", `${fakeMod.getName()}-state.yml`)).returns(Promise.resolve(false));

await mlProfileInstaller.addToStateFile(
await addToStateFile(
fakeMod,
fileMap,
profile
Expand Down

0 comments on commit cf001b1

Please sign in to comment.