mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-19 17:58:48 +00:00
Interactive test-electron
This commit is contained in:
25
test/test.js
25
test/test.js
@@ -33,29 +33,28 @@ delete window.testUtilities.prepareTests;
|
||||
window.textsecure.storage.protocol = window.getSignalProtocolStore();
|
||||
|
||||
!(function () {
|
||||
const passed = [];
|
||||
const failed = [];
|
||||
|
||||
class Reporter extends Mocha.reporters.HTML {
|
||||
constructor(runner, options) {
|
||||
super(runner, options);
|
||||
|
||||
runner.on('pass', test => passed.push(test.fullTitle()));
|
||||
runner.on('fail', (test, error) => {
|
||||
failed.push({
|
||||
testName: test.fullTitle(),
|
||||
error: error?.stack || String(error),
|
||||
});
|
||||
});
|
||||
runner.on('pass', test => window.testUtilities.onTestEvent({
|
||||
type: 'pass',
|
||||
title: test.titlePath(),
|
||||
}));
|
||||
runner.on('fail', (test, error) => window.testUtilities.onTestEvent({
|
||||
type: 'fail',
|
||||
title: test.titlePath(),
|
||||
error: error?.stack || String(error),
|
||||
}));
|
||||
|
||||
runner.on('end', () =>
|
||||
window.testUtilities.onComplete({ passed, failed })
|
||||
);
|
||||
runner.on('end', () => window.testUtilities.onTestEvent({ type: 'end' }));
|
||||
}
|
||||
}
|
||||
|
||||
mocha.reporter(Reporter);
|
||||
|
||||
mocha.setup(window.testUtilities.setup);
|
||||
|
||||
mocha.run();
|
||||
})();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user