JS-Test-Simple

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      - Added missing variable declarations. Patch from Pawel Chmielowski.
      - More portable fetching of the "body" element in Test.Builder.
        Based on patch from Pawel Chmielowski.
      - Added an "encoding" attribute to Test.Harness. This is largely to
        support pure JS tests, so that the browser harness can set up the
        proper encoding for the "script" elements it creates.
      - Added support for Opera, with thanks to Pawel Chmielowski.
      - Fixed the output from skipAll in the test harness.
      - Fixed display of summary of failed tests after all tests have been run
        by the browser harness. They are now displayed in a nicely formatted
        table without a "NaN" stuck where it doesn't belong.
      - COMPATIBILITY CHANGE: The browser harness now outputs failure
        information bold-faced and red. This required changing the "output"
        argument to the outputResults() method to an object with two methods,
        pass() and fail(). Anyone using Test.Harness.outputResults() will want
        to make any changes accordingly.
      - COMPATIBILITY CHANGE: new Test.Builder() now always returns a new
        Test.Builder object instead of a singleton. If you want the singleton,
        call Test.Builder.instance(). Test.Builder.create() has been
        deprecated and will be removed in a future release. This is different
        from how Perl's Test::Builder works, but is more JavaScript-like and

lib/JS/Test/Builder.js  view on Meta::CPAN

            }
        } else {
            // Ignore errors if hasOwnProperty() isn't available, as in 
            // Safari < 2.0.2 and Explorer 5.
        }
    }
};

Test.Builder.prototype.expectedTests = function (max) {
    if (max) {
        if (isNaN(max)) {
            Test.Builder.die(
                "Number of tests must be a postive integer. You gave it '"
                + max + "'." + Test.Builder.LF
            );
        }

        this.ExpectedTests = max.valueOf();
        this.HavePlan       = true;
        if (!this.noHeader()) this._print("1.." + max + Test.Builder.LF);
    }

tests/lib/Test/Builder.js  view on Meta::CPAN

            }
        } else {
            // Ignore errors if hasOwnProperty() isn't available, as in 
            // Safari < 2.0.2 and Explorer 5.
        }
    }
};

Test.Builder.prototype.expectedTests = function (max) {
    if (max) {
        if (isNaN(max)) {
            Test.Builder.die(
                "Number of tests must be a postive integer. You gave it '"
                + max + "'." + Test.Builder.LF
            );
        }

        this.ExpectedTests = max.valueOf();
        this.HavePlan       = true;
        if (!this.noHeader()) this._print("1.." + max + Test.Builder.LF);
    }



( run in 0.307 second using v1.01-cache-2.11-cpan-05444aca049 )