Running tests using mocha and requiring atom?


Is there a way to write our specs using mocha? What I am missing is a way to require 'atom' properly.

Any ideas?


I don’t know of one, but you may want to look at and for info on the infrastructure used to create a headless Atom environment for the Jasmine specs.

Run electron apps on Linux VPS

I still can’t find where the global variable atom came from in these files, it just appear out of thin air.




Atom = require '../src/atom'
window.atom = Atom.loadOrCreate('spec')

Now I need to get hold of the Atom class. I’ve attempted to require the whole Atom project, but then I got a bunch of build errors, not sure if this is the right thing to do.

  "devDependencies": {
    "atom": "atom/atom"

But then I found this thread

They spawned a headless Electron child process to run some tests, and even created a test-framework to do this. Can I do the same thing to Atom?