Default example doesn't work on windows machine.
See original GitHub issueThanks for the great tool there !
When I install mocha, and run the default example, it doesn’t work on my windows machine, In order for it to work I had to do the 2 things.
- Get the Electron Path
- Also add the default path to my Electron App as a First Argument.
Shouldn’t the default example include that ? i.e
var Application = require('spectron').Application;
var assert = require('assert');
var path = require('path');
describe('application launch', ()=> {
this.timeout(10000)
beforeEach(()=> {
this.app = new Application({
path: getElectronPath(),
args: [path.join(__dirname, '..')]
})
return this.app.start();
});
afterEach(()=> {
if (this.app && this.app.isRunning()) {
return this.app.stop()
}
})
it('shows an initial window', ()=> {
return this.app.client.getWindowCount().then(function (count) {
assert.equal(count, 1)
});
})
function getElectronPath() {
let electronPath = path.join(__dirname, '..', 'node_modules', '.bin', 'electron');
if (process.platform === 'win32') electronPath += '.cmd';
return electronPath;
}
});
I would gladly do a PR if you agree necessary
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Default apps are not working in Windows 10
In Windows 10 my default apps example: Xbox, music, calendar open then close I cant use any of my default apps Original title:...
Read more >7 Ways to Fix “Default Gateway Is Not Available” Error
How to Fix the Error. Solution 1: Remove any and all of the MacAfee programs from your PC. One of the reasons for...
Read more >How to Fix Set Default Location Button Not Working ... - YouTube
When you click on this default location option, it does nothing on Windows 11. Even if you enable the location and let apps...
Read more >[Fixed] No Sound on Windows 10 - Quickly & Easily
To fix, just click them, click Set Default, then click OK and test whether you have sound. Set default speakers Windows 10
Read more >Changing default startup directory for command prompt in ...
(Moral of the story: only change system files you know how to fix! Eventually after a Windows update it repaired itself.) What I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is a better way: https://github.com/electron/spectron/issues/86 and it works on all platforms
OH god, thanks for this… I was about to throw my debugger in the trash.