Skip to content

Commit 02f228d

Browse files
committed
added karma-tauri-launcher
1 parent a1fc3e2 commit 02f228d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

scripts/karma-tauri-launcher.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const TauriLauncher = /** @class */ (function () {
2+
3+
function TauriLauncher(baseBrowserDecorator, name, logger) {
4+
baseBrowserDecorator(this);
5+
let tauriCommand = ['dev'];
6+
if (name === 'TauriAndroid') {
7+
tauriCommand = ['android', 'dev'];
8+
}
9+
this._getOptions = function (url) {
10+
const tauriConfOverride = {build: {beforeDevCommand: '', devUrl: url}};
11+
return ['scripts/tauri-wrapper.js', ...tauriCommand, '-c', JSON.stringify(tauriConfOverride), '-f', 'karma'];
12+
};
13+
let log = logger.create('tauri');
14+
this._onStdout = function (data) {
15+
log.info(data.toString().trimEnd());
16+
};
17+
this._onStderr = function (data) {
18+
log.info(data.toString().trimEnd());
19+
};
20+
}
21+
22+
TauriLauncher.prototype = {
23+
name: 'Tauri',
24+
DEFAULT_CMD: new Proxy({}, {
25+
get: () => process.execPath,
26+
}),
27+
};
28+
29+
TauriLauncher.$inject = ['baseBrowserDecorator', 'name', 'logger'];
30+
31+
return TauriLauncher;
32+
}());
33+
34+
module.exports = {
35+
'launcher:TauriDesktop': ['type', TauriLauncher],
36+
'launcher:TauriAndroid': ['type', TauriLauncher],
37+
};

0 commit comments

Comments
 (0)