Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
Further adjustments for promise return, Issue #29
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve-Fenton committed Oct 22, 2017
1 parent 546645b commit 71ef27f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -110,7 +110,10 @@ in your file, you should use the import style shown for CalculatorSteps for your

AutoRunner.run(
'/Specifications/Basic.txt'
);
).then(() => {
// The promises resolves after all specifications have run
// including async steps.
});


## Step Definitions
Expand Down Expand Up @@ -215,6 +218,9 @@ The composition of the test is shown below.
You pass the list of specifications into the `run` method. Each specification is loaded, parsed,
and executed.

The `run` method returns a promise, should you need to execute code after the test. This allows you to run code after
all specifications have run, including where there are async steps.

## Excluding Specifications

You can exclude specifications by tag, by passing the tags to exclude to the SpecRunner before calling `runner.run(...`:
Expand Down
9 changes: 7 additions & 2 deletions TypeSpec/app.ts
Expand Up @@ -33,5 +33,10 @@ AutoRunner.run(
'/Specifications/MissingStep.txt',

//Excluded by tag
'/Specifications/ExcludedByTag.txt'
).then(() => { alert('Done'); }).catch((error) => { alert('Error! ' + error); });
'/Specifications/ExcludedByTag.txt')
.then(() => {
alert('Done');
})
.catch((error) => {
alert('Error! ' + error);
});

0 comments on commit 71ef27f

Please sign in to comment.