Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Quafadas committed May 25, 2024
1 parent 54a6049 commit c0d0582
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 34 deletions.
9 changes: 6 additions & 3 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import de.tobiasroeser.mill.vcs.version._

import com.goyeau.mill.scalafix.ScalafixModule

object project extends ScalaModule with PublishModule with ScalafmtModule with ScalafixModule {
trait FormatFix extends ScalafmtModule with ScalafixModule{
override def scalacOptions: Target[Seq[String]] = super.scalacOptions() ++ Seq("-Wunused:all")
}

object project extends ScalaModule with PublishModule with FormatFix {
def scalaVersion = "3.4.2"
def ivyDeps = super.ivyDeps() ++ Seq(
ivy"org.http4s::http4s-ember-server::0.23.26",
Expand All @@ -30,10 +34,9 @@ object project extends ScalaModule with PublishModule with ScalafmtModule with S

def artifactName = "live-server-scala-cli-js"

override def scalacOptions: Target[Seq[String]] = super.scalacOptions() ++ Seq("-Wunused:all")
def publishVersion = VcsVersion.vcsState().format()

object test extends ScalaTests with TestModule.Munit {
object test extends ScalaTests with TestModule.Munit with FormatFix {
def ivyDeps = super.ivyDeps() ++ project.ivyDeps() ++ Seq(
ivy"org.scalameta::munit::1.0.0",
ivy"com.microsoft.playwright:playwright:${playwrightVersion.pwV}",
Expand Down
1 change: 0 additions & 1 deletion project/src/live.server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.monovore.decline.effect.*

import fs2.*
import fs2.concurrent.Topic
import fs2.io.Watcher

import scribe.Level

Expand Down
3 changes: 2 additions & 1 deletion project/test/src/ConfigSpec.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import munit.CatsEffectSuite
import cats.effect.IO

import munit.CatsEffectSuite

class ConfigSpec extends CatsEffectSuite:

test("Valid Config Should Load") {
Expand Down
22 changes: 12 additions & 10 deletions project/test/src/RoutesSpec.scala
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import cats.effect.{IO, SyncIO}
import munit.CatsEffectSuite
import java.security.MessageDigest

import scala.concurrent.duration.DurationInt

import org.http4s.HttpRoutes
import org.typelevel.ci.CIStringSyntax

import fs2.concurrent.Topic
import fs2.io.file.Path
import fs2.io.file.Files

import cats.effect.IO
import cats.effect.kernel.Ref
import cats.effect.std.MapRef
import fs2.concurrent.Topic
import org.http4s.HttpRoutes
import cats.effect.kernel.Resource
import scribe.Scribe
import org.typelevel.ci.CIStringSyntax
import java.security.MessageDigest
import scala.concurrent.duration.DurationInt

import munit.CatsEffectSuite
// import cats.effect.unsafe.implicits.global

class ExampleSuite extends CatsEffectSuite:
Expand Down
3 changes: 0 additions & 3 deletions project/test/src/UtilityFcts.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import munit.CatsEffectSuite
import cats.effect.IO

class UtilityFcs extends munit.FunSuite:

test("That we actually inject the preloads ") {
Expand Down
24 changes: 8 additions & 16 deletions project/test/src/liveServer.test.scala
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
import scala.compiletime.uninitialized
import com.microsoft.playwright.*
import com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat
import com.sun.net.httpserver.*;
import java.net.InetSocketAddress;
import com.microsoft.playwright.Page.InputValueOptions
import java.nio.file.Paths
import com.microsoft.playwright.impl.driver.Driver
import scala.concurrent.Future

import cats.effect.unsafe.implicits.global
import scalatags.Text.styles
import cats.effect.IO
import org.http4s.HttpRoutes
import org.http4s.dsl.io.*
import org.http4s.ember.server.EmberServerBuilder

import com.comcast.ip4s.port
import com.comcast.ip4s.Port
import com.microsoft.playwright.*
import com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat

import org.http4s.dsl.io.*
import org.http4s.ember.server.EmberServerBuilder
import org.http4s.HttpRoutes
import cats.effect.IO
import cats.effect.unsafe.implicits.global
/*
Run
cs launch com.microsoft.playwright:playwright:1.41.1 -M "com.microsoft.playwright.CLI" -- install --with-deps
Expand Down Expand Up @@ -122,7 +114,7 @@ class PlaywrightTest extends munit.FunSuite:
val backendPort = 8089
val thisTestPort = 3005
// use http4s to instantiate a simple server that responds to /api/hello with 200, use Http4sEmberServer
val backend = EmberServerBuilder
EmberServerBuilder
.default[IO]
.withHttpApp(
HttpRoutes
Expand Down

0 comments on commit c0d0582

Please sign in to comment.