Switch branches/tags
Nothing to show
Commits on May 17, 2012
  1. Fix a bug with Hiro running all suites even though we want just one

    valueof committed May 17, 2012
    Yesterday I made a change that showed only the suite we wanted if
    you specify its name in a querystring. But I forgot to update Hiro
    itself to ignore all other suites so, as the result, today you
    would *see* just one suite while Hiro would *run* all suites behind
    the scenes. This patch fixes that.
  2. Add ability to run only one suite

    valueof committed May 17, 2012
    When working on a feature it is often nice to be able to run one
    particular suite. This patch modifies webui so that it reacts to
    a suite name being a part of a query string:
      http://localhost:7777/ <-- runs all tests
      http://localhost:7777/BasicTests <-- runs only BasicTests
    There's no UI for this yet because I'm not sure what's the best
    Even though the solution is partial it closes GH-23.
  3. Show failure location when possible

    valueof committed May 17, 2012
    Hiro 1 used to show location info whenever possible and, not to cause
    a regression, I backported it into Hiro 2. The code is slightly
    different, though: I got the latest version from QUnit's source code.
    This closes GH-22.
Commits on May 16, 2012
  1. More helpful message for timedout tests.

    valueof committed May 16, 2012
    Message like "Expected: ''. Actual: ''" is not very helpful.
    Instead, we need to clearly describe that timeout limit has been
    exceeded, etc.
  2. Add a way to specify custom timeout when pausing a test

    valueof committed May 16, 2012
    Sometimes you need more than the default timeout (250ms) to do
    your stuff. This patch adds a new argument to the Test.pause
    method that can be used to specify a custom timeout value.
      test.pause(500); // If after 500ms. test is still in paused
    	                 // state--consider it a failure.
Commits on May 14, 2012
  1. New README

    valueof committed May 14, 2012
    Since we're merging Hiro 2 to master we need a new README that
    reflects coding style changes and so on.
    I've also renamed file to plain README because Markdown doesn't
    seem to understand new lines and long lines are not very readable
    in plain text.
  2. Pass Test instance as the first argument instead

    valueof committed May 14, 2012
    So the change I made in 0931dd3
    was a mistake. Dynamically mixing in Suite and Test creates a
    clusterfuck in async tests.
    Instead I decided to introduce a backwards incompatible change and
    pass Test instance as the first argument of test case function.
    Value of 'this' in test case functions should refer to Suite
    instances only.
  3. Make suite running synchronous

    valueof committed May 14, 2012
    Although async execution of suites looks pretty it introduces lots
    of problems with sandbox conflicts. Also, progress bar looks like
    it came straight from Windows Me.
    Since I am lazy and don't want to hunt down each case of async bugs
    I just changed the whole thing to be synchronous.
  4. Add Sandbox.cleanup

    valueof committed May 14, 2012
    Since we don't want dozens of iframes flooding the DOM Sandbox needs
    a method to delete its container.
  5. Remove colons from onStart and Test case messages

    valueof committed May 14, 2012
    Colons should be handled in the UI, not in the library.
  6. Add Suite.getFixture method

    valueof committed May 14, 2012
    Suite.getFixture is used to get contents of a fixture without
    creating and appending an iframe to the DOM. Since we're not
    creating any iframes getFixture works only with data sandboxes.
  7. Change in-test context to a mixin of Test and Suite

    valueof committed May 14, 2012
    Apparently, you need to have methods from both Test and Suite
    instances inside of your test cases. Due to backwards compatibility
    it has to be bound to 'this', we can't just introduce a new object
    or argument.
    That's why we have to mixing Test and Suite objects together
    when test case is executed as a part of a suite (as opposed to
    manually creating and running a single Test instance).
  8. Fix backwards incompatible changes to the Sandbox.

    valueof committed May 14, 2012
    It seems like we forgot that a) we need references to window and
    document objects for URLed sandboxes b) older version of Hiro
    used to expose Suite.window and Suite.document.
    Since (a) is a sloppy mistake and (b) breaks current Hiro setups,
    we have to fix that.
  9. Don't display empty suites in webui

    valueof committed May 14, 2012
    Displaying empty (no test methods) suites in webui doesn't serve
    any purpose. Empty suites are quite useful, on the other hand,
    when you want to mixin setup functions into other non-empty suites.
    So the easiest solution here is to fix webui to ignore empty suites.
  10. Don't show fixture textareas

    valueof committed May 14, 2012
    We really don't need to see tons of textareas with fixtures in
    them so it's better to hide those elements. No need to explicitly
    hide <script> elements because they are not visible anyway.
  11. Bind onTest to an instance of Test

    valueof committed May 14, 2012
    Since onTest is being called before each test people use it to not
    only generate test arguments but to add additional properties to
    the test case and so on. This patch makes the code below possible:
      hiro.module("MySuite", {
    		onTest: function () { =  "who";
    		testSomething: function () {
    			myFunc(; // Will pass "who"
    However, to think about it, we just need to add an ability to
    have custom properties and methods in the suite declaration but
    that's an after-release task.
Commits on May 13, 2012
  1. Add support for PhantomJS

    valueof committed May 13, 2012
    It's nice to be able to run Hiro tests with PhantomJS. This patch
    ports PhantomJS integration from Hiro 1 to Hiro 2 (notice changes
    in hiro listeners, etc.)
    To run existing Hiro tests do the following:
     1. Install PhantomJS
     2. Start serving files by running 'grunt run'
     3. In another terminal run 'phantomjs bin/phantom.js'
    This patch closes GH-18.
  2. Disable run-all button when tests are running.

    valueof committed May 13, 2012
    It's a good practice to visually disable buttons that cannot or
    should not be pressed. Run-all button shouldn't be pressed when
    tests are already running so we need to disable it.
  3. Fail the test when onTest raises an exception

    valueof committed May 13, 2012
    It's _extremely_ annoying to spend time debugging frozen tests only
    to realize that the source of the problem is in the onTest method.
    We need to fail tests if, for whatever reason, onTest raises an
  4. Add support for this.expect in tests.

    valueof committed May 13, 2012
    Almost all non-trivial JavaScript programs use callbacks heavily.
    This means that sometimes you want to make sure that all your
    assertions executed, even those inside the callback functions.
    this.expect allows developers to explicitly specify how many
    assertions need to be executed for the code to pass.
    This patch closes GH-16 and GH-11.
Commits on May 12, 2012
  1. Show report for failed tests

    valueof committed May 12, 2012
    Having no information about your failed tests is quite annoying so
    I made webui to populate a hidden element with report data and then
    show it to the user. Schematically it looks like this:
      testSimpleAssertions    PASS
    	testExceptions          PASS
      testAsync               PASS
      testTitle               PASS
      testAuthor              PASS
      testFailedTest          FAIL
        Assertion: assertTrue
        Expected:  true
        Actual:    true
    In future, we should probably make Phantom output to resemble
    webui output.
  2. Fix a bug with progress bar going to 200%

    valueof committed May 12, 2012
    We bind test.onComplete listeners for all suites which means that
    we need a way to detect when a listener is called for a test that
    is outside of the current suite. The best way to do this is to
    check whether the test element exists.
Commits on May 11, 2012
  1. [webui] ability to run tests

    valueof committed May 11, 2012
Commits on Apr 29, 2012
  1. Extra semantic assertsions.

    marijn authored and valueof committed Apr 29, 2012
    Extracted from patch GH-12 by @marijn.
Commits on Apr 28, 2012
  1. Static version of WebUI

    valueof committed Apr 28, 2012
  2. No need to expose hiro object

    valueof committed Apr 28, 2012
Commits on Apr 27, 2012
  1. Add support for onTest

    valueof committed Apr 27, 2012
  2. Add support for setUp

    valueof committed Apr 27, 2012
  3. Add support for mixins

    valueof committed Apr 27, 2012
  4. Add default grunt task

    valueof committed Apr 27, 2012