0

I tried to use a file for a Unit test in a shared Module (https://github.com/portable-scala/sbt-crossproject)

I tried it in src/test/resources and src/main/resources

The resource was not copied to the .jvm/target/classes nor .jvm/target/test-classes

Is it not possible at all to use Resources in a shared Module or does it need a special configuration in sbt?

pme
  • 14,156
  • 3
  • 52
  • 95

2 Answers2

2

Resources are JVM specific, and so are not supported on the JS side without using some tricks. For more on this, see this answer by Scala.js' creator.

francoisr
  • 4,407
  • 1
  • 28
  • 48
1

With the idea of francoisr I found a workable solution.

What I did was to put the resources here:

shared/.jvm/src/test/resources/ which is used by sbt for the sharedJVM module.

Now this runs all the tests correctly:

sbt sharedJVM/test

pme
  • 14,156
  • 3
  • 52
  • 95