Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zio): support Native #432

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that why JS tests were not executed? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

),
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
Loading