sublime-test-runner icon indicating copy to clipboard operation
sublime-test-runner copied to clipboard

Don't understand how to use this

Open yairEO opened this issue 8 years ago • 3 comments

I don't even know what Makefile means, and google says it's some linux thing so I quickly closed the Google tab because I didn't want to know any irrelevant things. I'm a windows person.

I am running my mocha tests using NPM command npm run test-slimer spec yes, using slimerjs because I must use a headless browser to test my javascript code.

test-slimer is set to - "slimerjs tests/mocha-phantomjs-core.js tests.html"

How can I run my tests through sublime? my tests.html file is in the root directory and I want it to run when any file is saved.

Thank you!

yairEO avatar Oct 30 '16 10:10 yairEO

I don't know how slimerjs and mocha work together, but assuming you can set it up to provide TAP output to the console, you can override the default test command by going to Preferences > Package Settings > Test Runner > Settings User and writing something like this:

{
    "test_command": "npm run test-slimer tap",
}

(all options and their default values are at Preferences > Package Settings > Test Runner > Settings Default)

If your setup doesn't emit TAP output, this plugin should still run your test command, but you won't have in-editor test progress indicator and colored results.

accerqueira avatar Nov 01 '16 11:11 accerqueira

and how does sublime knows when my Slimer tests are completed? it's listening to the TAP file creation/change?


Slimer is a Mozilla kinda headless browser which can run tests (in my opinion is much much easier to deal with than phantomjs)

yairEO avatar Nov 02 '16 20:11 yairEO

It reads console output, assuming there is one,and waits for program termination.

accerqueira avatar Nov 02 '16 22:11 accerqueira