WIP: Add integration tests#1285
Conversation
| val result: Future[Any] = Executor | ||
| .execute(StarWarsSchema, query, new CharacterRepo, deferredResolver = new FriendsResolver) | ||
|
|
||
| result.map { x => |
There was a problem hiding this comment.
We could return some json instead to make it more realistic.
| Ok(s"ok:$x") | ||
| } | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Nitpick: configure your text editor to always add a new line.
There was a problem hiding this comment.
next scalaFmt command applied:
sbt it/scalafmtAll
| /* | ||
| Similar to the tests we have within => StarWarsQuerySpec but via controller | ||
| */ | ||
| class StarWarsQuerySpecISpec extends PlaySpec with Results { |
There was a problem hiding this comment.
To avoid relying on PlaySpec (one more dependency to take care of), could we "just" write assertions on a function returning a Future[Json]?
There was a problem hiding this comment.
As I understand, you are ok with using Play as an environment, but just drop PlaySpec specifically?
yeh, we I can do this
There was a problem hiding this comment.
suggested approach applied;
Don't see much difference, but let it be this way
There was a problem hiding this comment.
I'd actually prefer not using Play as an environment to avoid adding more dependencies
There was a problem hiding this comment.
What surrounding environment would you suggest? as I understand its not worth to continue experimenting with the Test play controller ?
There was a problem hiding this comment.
We can emulate an environment with a main function returning a Future[Json].
There was a problem hiding this comment.
ok, I've dropped Play dependency and use Future[String] to have more flexibility ;
so, now the only difference between StarWarsQuerySpecISpec and StarWarsQuerySpec is that we wrapped Executed within TestEnvironment
…on to handle json transformation instead;
No description provided.