mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
20 lines
603 B
TypeScript
20 lines
603 B
TypeScript
const path = require('path');
|
|
const { _electron: electron } = require('playwright');
|
|
|
|
const electronAppPath = path.join(__dirname, '../packages/bruno-electron');
|
|
|
|
exports.startApp = async () => {
|
|
const app = await electron.launch({
|
|
args: [electronAppPath]
|
|
});
|
|
const context = await app.context();
|
|
|
|
app.process().stdout.on('data', (data) => {
|
|
process.stdout.write(data.toString().replace(/^(?=.)/gm, '[Electron] |'));
|
|
});
|
|
app.process().stderr.on('data', (error) => {
|
|
process.stderr.write(error.toString().replace(/^(?=.)/gm, '[Electron] |'));
|
|
});
|
|
return { app, context };
|
|
};
|