FileKit.projectDir points to your module’s directory while tests run, so you can build paths to fixtures from shared test code.
Usage
Put the fixtures in a folder of your module, for examplesrc/commonTest/resources/hello.txt, then read them:
jvmTest
projectDir is declared in nonWebMain, so it doesn’t compile in commonTest when your module has JS or Wasm targets. Put the test in a test source set without web targets, such as jvmTest, iosTest, or a shared nonWebTest you declare. The fixtures folder can stay anywhere in the module.
How each platform finds the module
projectDir is for tests and tooling only. Don’t use it in production code.
Related
- App directories for runtime locations.
- Reading files for the full read API.