Skip to content

Commit e12212a

Browse files
authored
Merge pull request #432 from ThijsBroersen/feat/zio/support-native
feat(zio): support Native
2 parents 1a6e570 + 965eb35 commit e12212a

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

build.sbt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def dependenciesFor(version: String)(deps: (Option[(Long, Long)] => ModuleID)*):
2727
val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
2828
organization := "com.softwaremill.sttp.shared",
2929
libraryDependencies ++= Seq(
30-
"org.scalatest" %% "scalatest" % scalaTestVersion % Test
30+
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test
3131
),
3232
mimaPreviousArtifacts := Set.empty,
3333
versionScheme := Some("semver-spec")
@@ -59,14 +59,15 @@ val commonJsSettings = commonSettings ++ Seq(
5959
}
6060
},
6161
libraryDependencies ++= Seq(
62-
"org.scala-js" %%% "scalajs-dom" % "2.8.0"
62+
"org.scala-js" %%% "scalajs-dom" % "2.8.0",
63+
"io.github.cquiroz" %%% "scala-java-time" % "2.6.0" % Test
6364
)
6465
)
6566

6667
val commonNativeSettings = commonSettings ++ Seq(
6768
ideSkipProject := true,
6869
libraryDependencies ++= Seq(
69-
"org.scala-native" %%% "test-interface" % nativeVersion
70+
"io.github.cquiroz" %%% "scala-java-time" % "2.6.0" % Test
7071
)
7172
)
7273

@@ -241,6 +242,10 @@ lazy val zio = (projectMatrix in file("zio"))
241242
scalaVersions = scala2alive ++ scala3,
242243
settings = commonJsSettings ++ browserChromeTestSettings
243244
)
245+
.nativePlatform(
246+
scalaVersions = scala3,
247+
settings = commonNativeSettings
248+
)
244249
.dependsOn(core)
245250

246251
lazy val vertx = (projectMatrix in file("vertx"))

fs2/src/test/scala/sttp/capabilities/fs2/Fs2StreamsTest.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
package sttp.capabilities.fs2
22

33
import cats.effect.IO
4+
import cats.effect.unsafe
45
import cats.effect.unsafe.implicits.global
56
import fs2._
67
import org.scalatest.flatspec.AsyncFlatSpec
78
import org.scalatest.matchers.should.Matchers
89
import sttp.capabilities.StreamMaxLengthExceededException
10+
import scala.concurrent.ExecutionContext
911

1012
class Fs2StreamsTest extends AsyncFlatSpec with Matchers {
13+
14+
override implicit val executionContext: ExecutionContext = unsafe.IORuntime.global.compute
15+
1116
behavior of "Fs2Streams"
1217

1318
it should "Pass all bytes if limit is not exceeded" in {

zio/src/test/scala/sttp/capabilities/zio/ZioStreamsTest.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ import org.scalatest.matchers.should.Matchers
55
import sttp.capabilities.StreamMaxLengthExceededException
66
import zio._
77
import zio.stream.ZStream
8+
import scala.concurrent.ExecutionContext
89

910
class ZioStreamsTest extends AsyncFlatSpec with Matchers {
11+
override implicit val executionContext: ExecutionContext = Runtime.defaultExecutor.asExecutionContext
12+
1013
behavior of "ZioStreams"
1114

1215
implicit val r: Runtime[Any] = Runtime.default

0 commit comments

Comments
 (0)