Skip to content

Commit

Permalink
Merge pull request #432 from ThijsBroersen/feat/zio/support-native
Browse files Browse the repository at this point in the history
feat(zio): support Native
  • Loading branch information
adamw authored Sep 4, 2024
2 parents 1a6e570 + 965eb35 commit e12212a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def dependenciesFor(version: String)(deps: (Option[(Long, Long)] => ModuleID)*):
val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
organization := "com.softwaremill.sttp.shared",
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion % Test
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test
),
mimaPreviousArtifacts := Set.empty,
versionScheme := Some("semver-spec")
Expand Down Expand Up @@ -59,14 +59,15 @@ val commonJsSettings = commonSettings ++ Seq(
}
},
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.8.0"
"org.scala-js" %%% "scalajs-dom" % "2.8.0",
"io.github.cquiroz" %%% "scala-java-time" % "2.6.0" % Test
)
)

val commonNativeSettings = commonSettings ++ Seq(
ideSkipProject := true,
libraryDependencies ++= Seq(
"org.scala-native" %%% "test-interface" % nativeVersion
"io.github.cquiroz" %%% "scala-java-time" % "2.6.0" % Test
)
)

Expand Down Expand Up @@ -241,6 +242,10 @@ lazy val zio = (projectMatrix in file("zio"))
scalaVersions = scala2alive ++ scala3,
settings = commonJsSettings ++ browserChromeTestSettings
)
.nativePlatform(
scalaVersions = scala3,
settings = commonNativeSettings
)
.dependsOn(core)

lazy val vertx = (projectMatrix in file("vertx"))
Expand Down
5 changes: 5 additions & 0 deletions fs2/src/test/scala/sttp/capabilities/fs2/Fs2StreamsTest.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package sttp.capabilities.fs2

import cats.effect.IO
import cats.effect.unsafe
import cats.effect.unsafe.implicits.global
import fs2._
import org.scalatest.flatspec.AsyncFlatSpec
import org.scalatest.matchers.should.Matchers
import sttp.capabilities.StreamMaxLengthExceededException
import scala.concurrent.ExecutionContext

class Fs2StreamsTest extends AsyncFlatSpec with Matchers {

override implicit val executionContext: ExecutionContext = unsafe.IORuntime.global.compute

behavior of "Fs2Streams"

it should "Pass all bytes if limit is not exceeded" in {
Expand Down
3 changes: 3 additions & 0 deletions zio/src/test/scala/sttp/capabilities/zio/ZioStreamsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import org.scalatest.matchers.should.Matchers
import sttp.capabilities.StreamMaxLengthExceededException
import zio._
import zio.stream.ZStream
import scala.concurrent.ExecutionContext

class ZioStreamsTest extends AsyncFlatSpec with Matchers {
override implicit val executionContext: ExecutionContext = Runtime.defaultExecutor.asExecutionContext

behavior of "ZioStreams"

implicit val r: Runtime[Any] = Runtime.default
Expand Down

0 comments on commit e12212a

Please sign in to comment.