Comparing version 0.1.2 to 0.1.3
@@ -14,2 +14,3 @@ #!/usr/bin/env node | ||
console.log(' default - the default reporter'); | ||
console.log(' minimal - only reports results for tests changed from baseline'); | ||
console.log(); | ||
@@ -16,0 +17,0 @@ process.exit(); |
@@ -19,2 +19,3 @@ var __extends = this.__extends || function (d, b) { | ||
DefaultReporter.prototype.start = function (baselineTimestamp) { | ||
this.newLine(); | ||
if (baselineTimestamp) { | ||
@@ -26,3 +27,2 @@ this.writeLine("Tests will be compared to baseline established on " + baselineTimestamp.toLocaleDateString() + " at " + baselineTimestamp.toLocaleTimeString() + "."); | ||
DefaultReporter.prototype.end = function () { | ||
this.newLine(); | ||
var msg = "Completed " + this._tests + " tests"; | ||
@@ -40,2 +40,3 @@ if (this._pending > 0) { | ||
this.writeLine(msg); | ||
this.newLine(); | ||
}; | ||
@@ -42,0 +43,0 @@ DefaultReporter.prototype.suiteStart = function (suite) { |
@@ -21,2 +21,5 @@ var __extends = this.__extends || function (d, b) { | ||
} | ||
MinimalReporter.prototype.start = function (baselineTimestamp) { | ||
this.newLine(); | ||
}; | ||
MinimalReporter.prototype.end = function () { | ||
@@ -39,2 +42,3 @@ this.carriageReturn(); | ||
this.writeLine(msg); | ||
this.newLine(); | ||
}; | ||
@@ -41,0 +45,0 @@ MinimalReporter.prototype.suiteStart = function (suite) { |
{ | ||
"name": "baseline", | ||
"description": "A benchmarking library that allows performance to be compared to an established baseline.", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Artifact Health, LLC", |
@@ -14,2 +14,3 @@ # Baseline | ||
* [`Asynchronous tests`](#asynchronous-tests) | ||
* [`Hooks`](#hooks) | ||
@@ -57,3 +58,2 @@ | ||
Completed 2 tests. | ||
@@ -94,3 +94,2 @@ ``` | ||
Completed 2 tests, 1 slower. | ||
@@ -148,3 +147,2 @@ ``` | ||
Completed 2 tests. | ||
@@ -159,3 +157,3 @@ ``` | ||
Similar to [mocha](http://mochajs.org/), asynchronous tests are accomplished by include a callback, usually called | ||
Similar to [mocha](http://mochajs.org/), asynchronous tests are accomplished by including a callback, usually called | ||
`done`, as a parameter to the test function. The callback must be called once the test has completed. | ||
@@ -185,1 +183,58 @@ | ||
<a name="hooks" /> | ||
## Hooks | ||
Baseline provides the hooks before(), after(), beforeEach(), afterEach(), that can be used to setup and cleanup tests. | ||
During a test cycle, an individual test will be executed multiple times. Hooks must be written to take into account that | ||
they will not be executed around each execution of a test, but rather around a series of executions. | ||
``` | ||
suite('hooks', function() { | ||
before(function() { | ||
// runs before all tests in this block | ||
}); | ||
after(function(){ | ||
// runs after all tests in this block | ||
}); | ||
beforeEach(function(){ | ||
// runs before the first iteration of each test in this block | ||
}); | ||
afterEach(function(){ | ||
// runs after the last iteration of each test in this block | ||
}); | ||
// test cases | ||
}); | ||
``` | ||
<a name="pending-tests" /> | ||
## Pending tests | ||
Tests that do not have a callback are considered pending and are used to document tests that will be implemented in the | ||
future. | ||
``` | ||
suite("pending", function() { | ||
test("will be implemented later"); | ||
}); | ||
``` | ||
To temporarily skip a test, adding `.skip` to a test will put the test in a pending state and skip execution. | ||
``` | ||
suite("Regexp vs indexOf", function() { | ||
// other cases | ||
test.skip("indexOf", function() { | ||
// this test will not be executed | ||
}); | ||
}); | ||
``` | ||
## Reporters | ||
### Default | ||
The default reporter outputs results for each test case, including comparison tests. | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70731
1352
235