-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
3,358 additions
and
1,375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
import { TestRunner, TestSet, TestSetResults, TestOutcome } from "../core/alsatian-core"; | ||
import { createPromise } from "../promise/create-promise"; | ||
|
||
export class CliTestRunner extends TestRunner { | ||
export class CliTestRunner { | ||
|
||
public run(testSet: TestSet, timeout?: number) { | ||
public constructor(private _testRunner: TestRunner) { | ||
if (!_testRunner) { | ||
throw new TypeError("_testRunner must not be null or undefined."); | ||
} | ||
} | ||
|
||
try { | ||
let testRunPromise = super.run(testSet, timeout); | ||
public run(testSet: TestSet, timeout?: number) { | ||
|
||
testRunPromise.then((results: TestSetResults) => { | ||
if (results.outcome === TestOutcome.Error || results.outcome === TestOutcome.Fail) { | ||
process.exit(1); | ||
} | ||
else { | ||
process.exit(0); | ||
} | ||
}); | ||
} | ||
catch (error) { | ||
process.stderr.write(error.message); | ||
process.exit(1); | ||
} | ||
} | ||
try { | ||
let testRunPromise = this._testRunner.run(testSet, timeout); | ||
|
||
testRunPromise.then((results: TestSetResults) => { | ||
if (results.outcome === TestOutcome.Error || results.outcome === TestOutcome.Fail) { | ||
process.exit(1); | ||
} | ||
else { | ||
process.exit(0); | ||
} | ||
}) | ||
.catch(this._handleTestSetRunError); | ||
} | ||
catch (error) { | ||
this._handleTestSetRunError(error); | ||
} | ||
} | ||
|
||
private _handleTestSetRunError(error: Error) { | ||
process.stderr.write(error.message + "\n"); | ||
process.exit(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import { ITest } from "./test.i"; | ||
|
||
export interface ITestFixture { | ||
fixture: { [id: string]: (...args: Array<any>) => any }; | ||
fixture: { [id: string]: (...args: Array<any>) => any }; | ||
|
||
ignored: boolean; | ||
ignoreReason: string; | ||
ignored: boolean; | ||
ignoreReason: string; | ||
|
||
focussed: boolean; | ||
tests: Array<ITest>; | ||
addTest(test: ITest): void; | ||
getTests(): Array<ITest>; | ||
focussed: boolean; | ||
tests: Array<ITest>; | ||
|
||
description: string; | ||
addTest(test: ITest): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { TestRunner } from "./running/test-runner"; | ||
import { TestPlan } from "./running/test-plan"; | ||
import { TestItem } from "./running/test-item"; | ||
import { TestSetRunInfo } from "./running/test-set-run-info"; | ||
|
||
export { | ||
TestRunner, | ||
TestPlan, | ||
TestItem, | ||
TestSetRunInfo | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { PropertySpy } from "./spying/property-spy"; | ||
import { SpyCall } from "./spying/spy-call"; | ||
import { SpyOn } from "./spying/spy-on"; | ||
import { Spy } from "./spying/spy"; | ||
import { RestorableSpy } from "./spying/restorable-spy"; | ||
import { SpyOnProperty } from "./spying/spy-on-property"; | ||
import { FunctionSpy } from "./spying/function-spy"; | ||
import { RestorableFunctionSpy } from "./spying/restorable-function-spy"; | ||
|
||
export { | ||
SpyCall, | ||
SpyOn, | ||
Spy, | ||
RestorableSpy | ||
PropertySpy, | ||
SpyCall, | ||
SpyOn, | ||
SpyOnProperty, | ||
FunctionSpy, | ||
RestorableFunctionSpy | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.