bitovi / testee

Automated cross-browser JavaScript testing made easy
https://www.npmjs.com/package/testee
MIT License
119 stars 27 forks source link

re-run tests in-browser for easy debugging? #186

Closed chase-moskal closed 5 years ago

chase-moskal commented 5 years ago

i'm having a really hard time, with chrome, hitting F12 and F8 to halt execution before the test suite can run

if there was a button to rerun tests, i could see a test fail, and then i could hit F12, set to pause on exceptions, and then re-run the tests to start easy debugging

maybe a cli flag like --autorun=false or something could allow the developer to initiate the test run when they're ready

chasenlehara commented 5 years ago

Hi @chase-moskal, does opening the test suite in Chrome without involving testee not work for your use case? Usually I just have my test suite page open in browsers while I’m developing/debugging.

ivospinheiro commented 5 years ago

@chase-moskal are you using QUnit? If you know which test is failing you can do something like:

QUnit.test("test something", assert => {
  const done = assert.async();
  // ... your test
});

Since the done function isn't called the test will hang and you'll probably be able to check the browser logs or something.

chase-moskal commented 5 years ago

Hi @chase-moskal, does opening the test suite in Chrome without involving testee not work for your use case? Usually I just have my test suite page open in browsers while I’m developing/debugging.

holy moly, it really is that easy!

i then noticed this relevant part of the readme:

During development it is nice to have tests run when files change. Testee is unique in that you do not need Testee while developing. Test pages can be served locally by something like http-server or live-server and opened/reloaded in the browser at will. This is the recommended way to iterate when using Testee. Testee is better used to test against multiple browsers as part of your build and/or release process, or alongside Git hooks for commits or pushes.

stellar!