Skip to content

Commit

Permalink
Added test verifying serial execution
Browse files Browse the repository at this point in the history
  • Loading branch information
milessabin committed Jan 29, 2024
1 parent 63a6f10 commit 258c9ef
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions modules/core/src/test/scala/subscription/SubscriptionSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,36 @@ final class SubscriptionSuite extends CatsEffectSuite {

}

test("serial execution") {
val mutation =
"""
mutation {
one:put(n: 1)
two:put(n: 2)
three:put(n: 3)
}
"""

val prog: IO[Json] =
for {
ref <- SignallingRef[IO, Int](0)
map = mapping(ref)
r <- map.compileAndRun(mutation)
} yield r

assertIO(prog,
json"""
{
"data" : {
"one" : 1,
"two" : 2,
"three" : 3
}
}
"""
)
}

test("subscription") {

val prog: IO[List[Json]] =
Expand Down

0 comments on commit 258c9ef

Please sign in to comment.