Closed Myrdden closed 3 years ago
Right so my actual goal was to have it run any js file in spec whilst excluding helpers/ and evidently if there's a test condition in helpers/ it will get run regardless of what spec_files says so I suppose that solves my problem... I don't know if this is a bug per say or I'm just using the app wrong.
I'm not sure I fully understand your situation, but I think it's something like this:
helpers
glob in jasmine.json
.it
.it
calls in it to create tests.spec_files
glob in jasmine.json
.Is that right? If so, the behavior you're seeing is expected and not a bug. Calling it
during startup creates a test, regardless of what file it was called from. If you don't want the helper file to be loaded at all, make sure that none of the globs in jasmine.json
match it. If you want it to load but don't want it to create tests, remove the calls to describe
, it
, etc.
If I've misunderstood the situation, please provide more information. A minimal, working example including complete copies of jasmine.json
and the helper file, along with their paths, would help a lot.
Jasmine considers helper files as separate from spec files. The main reason the helper files are expected to live within the spec_files
folder is to keep them separate from production code. Anything that matches the helpers globs (with exclusions, etc.) will always be loaded for any Jasmine execution. The general recommendation is that any calls to describe
and it
should be only in spec files.
Fair enough, will do. Thanks!
So, here's a dummy setup:
So I'm trying to exclude
exclude/
, but nothing of the following I've tried has worked.How do I exclude specific directory(s) and run everything else?