jasmine-npm icon indicating copy to clipboard operation
jasmine-npm copied to clipboard

Can I use jasmine without jasmine.json?

Open elgs opened this issue 5 years ago • 2 comments

Basically I want run jasmine command and it will run all *spec.js under spec directory. But I hate to maintain jasmine.json as another config file. I wonder if there's any default values for like spec_dir and spec_files. I'd love to follow the default values, if any. I will never want to customize them. Even command line argument like npx jasmine -spec_dir spec would be great to me. Thanks.

elgs avatar Oct 02 '19 09:10 elgs

There is not currently a way to run Jasmine with the Node.js tooling without specifying a config file (either via the --config argument or JASMINE_CONFIG_PATH environment variable). I could see there being a use case though to just skip loading a config file altogether if one wasn't specified on the command line, and the default location didn't exist. The change for this would actually be over in jasmine-npm, and I would want to make sure everything still worked properly without a configuration call. I would be happy to review a pull request there to make this change.

Thanks for using Jasmine!

slackersoft avatar Oct 15 '19 00:10 slackersoft

Thanks for clarifying it.

elgs avatar Oct 15 '19 01:10 elgs

Nowadays npx jasmine spec/**/*.js works for running all specs in a directory without a config file. (Or with quotes, npx jasmine 'spec/**/*.js' if you're using a shell that doesn't do bash-compatible file globbing.)

sgravrock avatar Aug 13 '23 22:08 sgravrock