OnetapInc / chromy

Chromy is a library for operating headless chrome. 🍺🍺🍺
MIT License
605 stars 41 forks source link

Tests falsifiability #109

Open AkA84 opened 6 years ago

AkA84 commented 6 years ago

Hello! I wanted to contribute and add a waitWhileVisible method (based on our discussion in #20 ), but I can't seem to be able to falsify the tests: as long as there is a method with the given name the test passes, no matter if the method does anything at all.

I tried the same with already existing methods, namely wait and waitUntilVisible, and the result is the same: if I strip away the content of the method entirely

class Document {
  // ...
  async wait (cond) {}
}

the test still passes once I run npm run compile && npm run test

> WITH_BABEL=1 mocha dist_test --compilers js:babel-core/register --require babel-polyfill

  wait
    βœ“ wait selector (1099ms)

  1 passing (1s)

I'm probably missing something obvious here...