Skip to content

Commit 7f9470a

Browse files
committed
Implemented missing TestUtil method
Signed-off-by: Clovis Durand <cd.clovel19@gmail.com>
1 parent 42989e3 commit 7f9470a

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

test/testUtil.ts

+20-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export class TestUtil {
2626

2727
public static thisPluginPath = path.join(__dirname, "../..");
2828

29+
public static defaultShouldUseWkWebView = 0;
30+
2931
public static defaultAndroidServerUrl = "http://10.0.2.2:3001";
3032
public static defaultIOSServerUrl = "http://127.0.0.1:3000";
3133

@@ -54,6 +56,16 @@ export class TestUtil {
5456
return testUpdatesDirectory;
5557
}
5658

59+
/**
60+
* Reads wether or not whe should use WkWebView.
61+
*/
62+
public static readShouldUseWkWebView(): number {
63+
var commandLineOption = parseInt(TestUtil.readMochaCommandLineOption(TestUtil.SHOULD_USE_WKWEBVIEW));
64+
var shouldUseWkWebView = commandLineOption ? commandLineOption : TestUtil.defaultShouldUseWkWebView;
65+
console.log("shouldUseWkWebView = " + shouldUseWkWebView);
66+
return shouldUseWkWebView;
67+
}
68+
5769
/**
5870
* Reads the path of the plugin (whether or not we should use the local copy or pull from npm)
5971
*/
@@ -256,7 +268,14 @@ export class TestUtil {
256268
console.log("Running command: " + command);
257269
}
258270

259-
child_process.exec(command, options, (error: Error, stdout: Buffer, stderr: Buffer) => {
271+
child_process.exec(
272+
command,
273+
options,
274+
(
275+
error: child_process.ExecException | null,
276+
stdout: Buffer | string,
277+
stderr: Buffer | string,
278+
) => {
260279

261280
result += stdout;
262281

0 commit comments

Comments
 (0)