Selective apm testing would be useful


#1

I’m just taking a first look at adding features to an existing package. It already has a substantial test suite, running in about 10s. That’s a bit slow, particularly for a fast-iterating early stage of development (when I hardly know what I’m doing!).

I would love to be able to run just the tests for the feature I’m developing (something like apm test [spec file name]).


#2

This is already supported in Jasmine - it’s called spec focusing. Try adding f infront of describe or it to focus the spec runner accordingly.

Assuming you’re talking about go-plus, you might want to hop in the Gitter room for it and I’ll help you out interactively.


#3

According to the docs:

To run a limited subset of specs use the fdescribe or fit methods. You can use those to focus a single spec or several specs


#4

Thanks guys, the fxx variants do the trick. Test selection is a function of the test runner in environments I’m used to, but this approach works just as well.

@joefitzgerald Yes, go-plus is what I have in mind (I’m playing with a couple of things to scratch some itches while learning how to extend Atom). Just familiarising myself with the APIs and dev environment now, being new to Atom and coffeescript. Thanks for the offer of help; I’ll take you up on it if I hit issues, and certainly before submitting pull requests.


#5

Also, keep in mind that on a Mac, you can press ⌃-⌥-⌘-P (CTRL-OPTION-COMMAND-P) to run the specs for the package while Atom is open.


#6

And ctrl-win-alt-p on Linux/Win.

This is a good way to see deprecation warnings, too.


#7

Good point, @dsandstrom. I used to run the tests from the command line until they added the deprecation warnings in … now I’m back to running tests through the UI.


#8

Not to sound too spoiled, but I’d actually much prefer this was an option from the command line. At the moment my jumpy package does like integration style tests. So instead for quick iteration I’ll often reload atom -d just to quick test… “works at all”

Really any number of my tests if I could quickly run it alone would serve as a good half way checkpoint before continuing code / refactoring. I will of course sometimes throw an f, especially if it’s of course related code failing, but then I have to manage this with git etc…

Was just wondering if someone’s already done this since, for some other reason perhaps. I know kind of nitpicking :slight_smile: