mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added constructor using mock files.
This commit is contained in:
@@ -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
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user