Added constructor using mock files.

This commit is contained in:
BSO
2015-12-15 10:14:58 +01:00
parent 8adab1a506
commit 911b32f0ce
2 changed files with 13 additions and 5 deletions
@@ -9,7 +9,8 @@ function TestConfig() {
function TestCtorOverloads() {
let noParam: mock.ProtractorHttpMock = mock();
let emptyArray: mock.ProtractorHttpMock = mock([]);
let emptyArray: mock.ProtractorHttpMock = mock([]);
let mockFiles: mock.ProtractorHttpMock = mock(['mock1', 'mock2']);
let skipDefaults: mock.ProtractorHttpMock = mock([], true);
let del: mock.requests.Delete<number> = {
+11 -4
View File
@@ -9,15 +9,22 @@ declare module mock {
interface ProtractorHttpMock {
/**
* Instantiate mock module. This must be done before the browser connects.
*
*
* @param mocks An array of mock modules to load into the application.
* @param skipDefaults Set true to skip loading of default mocks.
*/
<T>(mocks?: Array<requests.BaseRequest<T>>, skipDefaults?: boolean): ProtractorHttpMock;
/**
* Instantiate mock modules from files. This must be done before the browser connects.
*
* @param mocks An array of mock module names relative to the rootDirectory configuration.
*/
(mocks: Array<string>): ProtractorHttpMock;
/**
* Clean up.
* Typically done in the afterEach call to ensure the teardown
* Typically done in the afterEach call to ensure the teardown
* is executed regardless of what happens in the test execution.
*/
teardown(): void;
@@ -35,7 +42,7 @@ declare module mock {
clearRequests(): webdriver.promise.Promise<boolean>;
/**
* Module configuration to setup
* Module configuration to setup
*/
config: {
/**
@@ -51,7 +58,7 @@ declare module mock {
protractorConfig?: string;
};
}
/**
* Matched request.
*/