Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Jan 18, 2025
1 parent d0aa120 commit ded23b0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ neoForge {
guideme {
sourceSet sourceSets.main
}
guidemetest {
sourceSet sourceSets.main
sourceSet sourceSets.test
}
}

runs {
Expand Down Expand Up @@ -171,7 +175,7 @@ neoForge {

unitTest {
enable()
testedMod = mods.guideme
testedMod = mods.guidemetest
}
}

Expand Down
19 changes: 19 additions & 0 deletions src/test/java/guideme/guidebook/TestMod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package guideme.guidebook;

import cpw.mods.modlauncher.Launcher;
import guideme.GuideME;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.common.asm.RuntimeDistCleaner;

@Mod(value = GuideME.MOD_ID)
public class TestMod {
public TestMod(ModContainer modContainer, IEventBus modBus) {
var cleaner = (RuntimeDistCleaner) Launcher.INSTANCE.environment().findLaunchPlugin("runtimedistcleaner").get();
cleaner.setDistribution(Dist.CLIENT);

new GuideME(modContainer, modBus);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ private GuidePage compilePage(String id) throws Exception {
.developmentSources(guidebookFolder)
.watchDevelopmentSources(false)
.registerReloadListener(false)
.disableOpenHotkey()
.build();
return PageCompiler.compile(testPages, ExtensionCollection.empty(), parsed);
}
Expand Down

0 comments on commit ded23b0

Please sign in to comment.