question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

airspec: Callling scalaJsSupport is a bit verbose and confusing

See original GitHub issue

To use airspec on Scala.js, is is required to invoke scalaJsSupport in test code.

https://github.com/wvlet/airframe/blob/9277263b0d507ea7459a12fef82d301395fd3463/airspec/src/test/scala/examples/TestSpec.scala#L24-L25

The reason is mentoined in below

https://github.com/wvlet/airframe/blob/master/docs/airspec.md This is because Scala.js has no runtime reflection to find methods in AirSpec classes, so we need to provide method data by calling scalaJsSupport. Internally this will generate MethodSurfaces (airframe-surface), so that AirSpec can find test methods at runtime. Calling scalaJsSupport has no effect in Scala JVM platform, so you can use the same test spec both for Scala and Scala.js.

I think this is…,

  • A bit verbose.
    • Adding scalaNativeSupport when airspec support Scala Native ?
  • Confusing for airspec beginner, specially when migrating from scalatest, which does not require extra step like scalaJsSupport.
    • Test code is succesfully compiled without scalaJsSupport, but no tests run at all !!
    • I spent several hours to figure out scalaJsSupport is required…

It would be great if scalaJsSupport is deprecated ang gone. Regarding “runtime reflection in Scala.js”, portable-scala-reflect might help.

Or, it may be OK if airspec warns like No test classes with scalaJsSupportfound. See https//.....

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
xerialcommented, Jan 23, 2020

With #909, if no test case is found, a warning message will be shown. Actually some test cases of AirSpec itself were also missing scalaJsSupport 😅

1reaction
xerialcommented, Jan 22, 2020

Thanks. I agree that adding scalaJsSupport is a bit annoying. Personally, I’ve started using only test(…) method for Scala.js.

Two action items:

  • Showing test(...) function first will be helpful for new users to avoid such confusion.
  • Adding a warning message when scalaJsSupport is missing.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Verbose Definition & Meaning - Merriam-Webster
The meaning of VERBOSE is containing more words than necessary : wordy; also : impaired by wordiness. How to use verbose in a...
Read more >
Verbose Definition & Meaning - Dictionary.com
Verbose definition, characterized by the use of many or too many words; wordy: a verbose report. See more. ... WORDS THAT MAY BE...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found