fix version flags displaying bad version on linux (#1422) (#2089)

yargs, the command line parsing library, was unable to read the app's version automatically from package.json
fix by passing the app's version as electron sees it
This commit is contained in:
vas
2022-05-10 22:52:33 +03:00
committed by GitHub
parent 4ebaebfd17
commit 8dd7d3dcc5
4 changed files with 43 additions and 22 deletions

View File

@@ -170,16 +170,6 @@ describe('main/app/initialize', () => {
await initialize();
expect(app.setPath).toHaveBeenCalledWith('userData', '/basedir/some/dir');
});
it('should show version and exit when specified', async () => {
jest.spyOn(process.stdout, 'write').mockImplementation(() => {});
const exitSpy = jest.spyOn(process, 'exit').mockImplementation(() => {});
parseArgs.mockReturnValue({
version: true,
});
await initialize();
expect(exitSpy).toHaveBeenCalledWith(0);
});
});
describe('initializeConfig', () => {