How do I run a subset of tests?


I’m trying to contribute to the tensorflow/tfjs repo for TensorFlow.js, but I’m wondering why locally running yarn test --//:grep=multinomial to run a subset of tests doesn’t seem to be working for me. It seems to output almost the same thing as yarn test. How are y’all running tests when developing for the JavaScript repo?

You can see what I’ve tried so far and the outputs at trying to run a subset of tests seems to just run them all · Issue #8164 · tensorflow/tfjs · GitHub. I just discovered this forum and reaching out here too to see if I can get more answers. I don’t have much space left on my old laptop, so I’ve resorted to using a github codespace.

I think it may be saying that it’s running the tests, but it’s actually not. You can verify this by breaking one of the tests you’re not grepping for. This is definitely not intuitive (sorry!). What I usually do is edit the test file I’m working on and add fit in place of it on the test I’d like to focus on. This is Jasmine’s standard way of temporarily focusing tests. When running them like this, jasmine should list the other specs as skipped.