Flow/qunit

From mediawiki.org
(Redirected from Flow/Team/Processes/qunit)

Timo


Problems in browser[edit]

browser console errors

Previous $.noop error was after initialization.

  • browser tests don't warn about uncaught exceptions
  • Jenkins qunit doesn't try to initialize everything, but maybe we could have an "integratio" test for "I instantiated this board, I set up a few components, nothing blew up."


Feedback on our tests[edit]

  • In jQuery, simple tag creation is OK, but anything with attributes should be valid HTML, so with closed elements.

Feedback on our JS code[edit]

Why mw.flow = mw.flow || {} ; ?

  • use an init file
  • then each file does mw.flow.myModule
  • good that we're not doing much transformation of our API results in JS
  • we should be testing our API in phpunit, using the improved non FauxRequest using context config, the way core tests like tests/phpunit/includes/api/ApiEditPageTest.php. It's coming, for now use ApiTestCase.

pain points[edit]

  • API testing is hard,
    • Tim:improvements coming but don't wait.
    • Timo: when we test the API, don't actually round-trip to the server, mock the server response

browser test vs. qunit.

  • Example: When I lock a topic, there is no Reply or Edit button.
  • Example: If I'm anonymous I don't see anything about a hidden button
    • could data transform into HTML, then check to see what's there.
    • or could add functions doIHaveEditRights() and assert that.


TODO:[edit]

  • use grunt and gruntfile to set up tests, use switch them to use jscs as well
  • then get jenkins to call Flow's npm test
  • have grunt watch permanently watching your local filesystem for changes.
  • use jshint integration in editor
  • clean up "new" structure