Please add test cases for the sake of helping users of the library
See original GitHub issueTest caseio.finch.iteratee.EnumerateEndpointSpec
does not contain any useful test case from the users’ perspective.
I’m trying to do something as simple as:
package com.example.helloworld
import cats.effect.IO
import com.twitter.finagle.Http
import com.twitter.util.Await
import io.iteratee.{Enumerator, Iteratee}
import io.finch._
import io.finch.circe._
import io.finch.iteratee._
import io.finch.catsEffect._
object Main extends App {
def concat: Endpoint[IO, String] = post("concat" :: enumeratorBody[IO, String, Text.Plain]) {
enum: Enumerator[IO, String] =>
enum.into(Iteratee.fold[IO, String, String]("")(_ + _)).map(Ok)
}
Await.ready(
Http.server
.serve(":8081", (concat).toServiceAs[Text.Plain])
)
}
with a deadly simple test case as
package com.example.helloworld
import org.scalatest.FunSuite
class MainTest extends FunSuite {
test("helloWorld") {
import io.finch._
val body: String =
"""{"i":"aaaaa"}
|{"i":"bbbbb"}
""".stripMargin
assert(
Main.concat(
Input
.post("/concat")
.withBody[Text.Plain](body)).awaitValueUnsafe() == Some("aaaaabbbbb"))
}
}
and it does not work. So, it’s clear that I’m doing something wrong… but what?
Looking for test cases, there’s nothing which could provide any clue why things are going wrong.
So, please add test cases not only when things go wrong, but also showing what needs to be done in order to obtain positive results.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9
Top Results From Across the Web
180+ Web Application Testing Example Test Cases (Sample ...
Using this checklist, you can easily create hundreds of Test cases for testing web or desktop applications. These are all general test cases...
Read more >Unit Testing Best Practices: 9 to Ensure You Do It Right
Do you know any unit testing best practice? In this post, you'll learn nine of them so you can get started the right...
Read more >Writing Automated Tests for Accessibility - Deque Systems
In this post, we'll highlight the strengths and weaknesses of automated testing for web accessibility to both add value to your workflow and ......
Read more >Software Testing: 101 Top Tips, Tricks and Strategies - Stackify
Software testing is a collection of tests to determine if a software app works and will continue working. Get tips and tricks from...
Read more >The Best Test Case Management Tool for Jira
If you need some help your evaluation of test case management tools for Jira we'd be happy to ... Or when creating your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@frgomes
I think we can close this. The upcoming 0.27 release has all the missing pieces outlined by this issue.