Permalink
Commits on Oct 27, 2010
  1. Make the expandFiles callback have an error argument

    Benjamin Thomas committed Oct 27, 2010
  2. Add runFile() method for running a suite file in a child process

    Benjamin Thomas committed Oct 27, 2010
    Preliminary support.  Still have to test more thoroughly and update the
    web runner to use the runFile method.
  3. Update docs and README

    Benjamin Thomas committed Oct 27, 2010
  4. Move documentation from READMe to HTML in 'docs' folder

    Benjamin Thomas committed Oct 27, 2010
  5. Fix trying to run the wrong file in bin/test-output.sh

    Benjamin Thomas committed Oct 27, 2010
Commits on Oct 26, 2010
  1. Clean up code a little bit

    Benjamin Thomas committed Oct 26, 2010
  2. Update 'flow' tests, add script for testing output

    Benjamin Thomas committed Oct 26, 2010
Commits on Oct 25, 2010
  1. Update for sys -> util change

    Benjamin Thomas committed Oct 25, 2010
Commits on Oct 24, 2010
  1. Add suiteSetup/suiteTeardown to wrap

    Benjamin Thomas committed Oct 24, 2010
Commits on Oct 22, 2010
  1. Re-add setup/teardown functions

    Benjamin Thomas committed Oct 22, 2010
    Re-add some of the functionallity that I removed in
    e509041.  Now instead of supplying a
    function for a test you can supply an array of functions.  The first
    and last functions in this array are considered setup and teardown
    functions respectively.  If the setup function was run, then no matter
    if the test passes or fails, the teardown function will be run no matter
    what.  You can do this multiple times, so instead of supply an array of
    length 3 you can do one of length 5.  In that case the second function
    will only be run if the first one completes successfully, and the the
    third the second.  However, the fourth (second to last) will be run no
    matter what if the second was run and the last will be run no matter
    what if the first was run.
    
    This sounds complicated, but I don't anticipate anyone using this raw
    API.  It is mainly for the wrap function to use for the suiteSetup,
    suiteTeardown, setup and teardown functions.  This way you know for sure
    that your teardown and suiteTeardown will be run which wasn't possible
    before (suiteTeardown doesn't exist yet). This would arise if a test
    failed then there was no way to make sure a teardown was run.  Which
    sort of defeats the whole point of a teardown.
Commits on Oct 21, 2010
  1. Update web runner to work with new error API.

    Benjamin Thomas committed Oct 21, 2010
Commits on Oct 9, 2010
  1. Make unexpected errors kill the process

    Benjamin Thomas committed Oct 9, 2010
    I realized I was going to A LOT of effort to catch and report on
    run-time errors in code, and this was majorly complicating the way the
    whole library was being written.
    
    But I figure if there is an error, it is something that is a show
    stopper anyway, and you need to be notified about it immediately.
    
    Suite runners will be notified of the error, right before the process
    exits, so they can say what happened.
    
    If you still really want errors to be caught, use the wrap function to
    add a setup to all your tests and then set the uncaughtExceptionHandler
    in the test.  You'll have to run the suite in parallel then.
  2. Beginning support for built-in setup/teardown functions

    Benjamin Thomas committed Oct 9, 2010
    Basically, you can't do them properly without building them in.  The API
    will probably change.
Commits on Oct 8, 2010
  1. Restructer how tests are ran

    Benjamin Thomas committed Oct 8, 2010
    This change cleans up the test running code quite a bit.  Now (more
    logically) whenever a test finishes, whether by assertion failure, error
    or a `test.finish()` call, it all goes through the `testFinished`
    function.  Before errors were handled differently.
    
    We also simplify the event API for writing test runners.  Before we had
    4 different kind of result objects, now we have 2 (mostly).  I know this
    is a backwards incompatible change, but it isn't to the public API, but
    to the test runner API which I think I am the only one doing.  So, if
    this is breaking your code, please let me know.
    
    We restructred as a preface to proper setup/teardown support, which hopefully
    I'll get to tonight.
Commits on Oct 7, 2010
  1. Move example suite

    Benjamin Thomas committed Oct 7, 2010
Commits on Sep 27, 2010
  1. Make the `run` method `process.exit` with the number of failed tests

    Benjamin Thomas committed Sep 27, 2010
    Right now `run` takes three arguments:
    
    list:      file or directory or array of files or directories
    args:      array of command line arguments to change settings
    callback:  a callback for when it has run all suites
    
    This changes the third argument so that if it is not provided, when all
    suites have finished this will call process.exit with a status code equal
    to the number of tests that failed.  If you don't need a callback but
    don't want it to do that, then pass something falsey
    
    Now that we have this there is no reason to use the `node-async-test`
    command, so it has been deprecated.
  2. Update wrap tests to hande sub suites (and use them!)

    Benjamin Thomas committed Sep 27, 2010
  3. Add the ability for 'sub-suites'

    Benjamin Thomas committed Sep 27, 2010
    Since suites are just objects, it is very easy to make it so you can
    have 'sub suites'.  Really this is more like namespacing. All it does is
    load all the tests in a sub suite into the main suite but prefixes
    their name with the name of the sub suite.  Trivially easy to implement
    and shouldn't slow things down at all.
    
    I decided it was useful when writing tests for the new wrap function.
    Now you can have setup/teardown functions specific to a sub suite by
    'wrapping' the sub suite.
    
    Will update the wrap tests next with some more examples.
  4. Reorganize a bit

    Benjamin Thomas committed Sep 27, 2010
    lib/async_testing was getting quite big. Moved testing code to
    lib/testing.js. Moved running code to lib/running.js.  Left stuff that
    didn't really belong in either of those where it was.
    
    Also changed the way you register runners.  Now all information related
    to a runner is kept in the exports of the module for the runner.
  5. Switch to using module.exports for test suites

    Benjamin Thomas committed Sep 27, 2010
Commits on Sep 26, 2010
  1. Deprecate `exports.wrapTests` and add better `exports.wrap`

    Benjamin Thomas committed Sep 26, 2010
    `wrapTests` was a major pain in the butt to use.  We now have `wrap`
    which is specifically for adding setup and teardown functions.
    
    `wrap` takes an object which has three properties:
    
    (by the way, I'm looking for a better name for this function)
    
    suite:     a test suite object, required
    setup:     a function that should be run before the test
    teardown:  a function that should be run after the test
    
    setup and teardown can both be asynchronous (and thus both must
    explicitly call `done` or `finish` or whatever you want to call the
    function).
    
        wrap({ suite: exports
             , setup: function setup(test, done) {
                 test.ok(true, 'make sure we run the setup');
                 test.one = extra1;
                 test.two = extra2;
    
                 done();
               }
             , teardown: function teardown(test, done) {
                 test.ok(true, 'make sure we run the teardown');
    
                 done();
               }
             });
Commits on Sep 15, 2010
  1. Update README.

    Benjamin Thomas committed Sep 15, 2010
  2. Remove dependencies on socket.io and webworker

    Benjamin Thomas committed Sep 15, 2010
    The web runner still depends on them but we shouldn't make everyone have
    to install those dependencies if they aren't going to use them.
  3. Fix Firefox support. Still having trouble in Opera

    Benjamin Thomas committed Sep 15, 2010
  4. Include socket.io client code as a submodule

    Benjamin Thomas committed Sep 15, 2010
    Before I handpicked what I thought was necessary, now I don't have to
    keep track/guess, I can just pull the most up to date code.
  5. Fix bug in custom assertions code

    Benjamin Thomas committed Sep 15, 2010
  6. Make node-async-testing more extendable

    Benjamin Thomas committed Sep 15, 2010
    Can now register custom assertion functions:
    
      require('async_testing').registerAssertion(assertionName, function() { ... });
    
      suite.myTest = function(test) {
        test.assertionName();
        test.finish();
      }
    
    Can now register your own test runners to be options for the run command:
    
      // register it
      require('async_testing').registerRunner(
        'Name',
        'path/to/runner',
        {description: 'My runner', longFlag: 'myRunner', shortFlag: 'm'}
      );
    
      // from the command line:
      node-async-test test-file.js --myRunner
      // or
      node-async-test test-file.js -m
Commits on Sep 4, 2010
  1. Add disclaimer about browser support for the web runner

    Benjamin Thomas committed Sep 4, 2010
  2. Handle errors in test files, updated README

    Benjamin Thomas committed Sep 4, 2010
Commits on Sep 3, 2010
  1. Update web runner to update UI when test files are changed.

    Benjamin Thomas committed Sep 3, 2010
    Web site will now sure the current tests. Even if you add remove tests.
    It already would run the most up to date tests, but now it properly
    shows what it is doing.
  2. Rename default runner and change runSuites to only run files.

    Benjamin Thomas committed Sep 3, 2010
    Change the default runner to something more descriptive.  We'll still
    know it is the default in our hearts though.
    
    Changing runSuites to only run files/directories (and renaming it
    runFiles) is a much bigger change.  If you want to run a specific
    suite object, just call runSuite directly with the object.
    
    Runners can now assume that all items are files or directories.
Commits on Sep 2, 2010
  1. Make sure we can terminate before terminating

    Benjamin Thomas committed Sep 2, 2010
  2. Fix inproperly labelled assertions.

    Benjamin Thomas committed Sep 2, 2010