jasmine / jasmine-npm

A jasmine runner for node projects.
MIT License
376 stars 145 forks source link

Can I use jasmine without jasmine.json? #181

Closed elgs closed 1 year ago

elgs commented 4 years ago

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.

slackersoft commented 4 years ago

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!

elgs commented 4 years ago

Thanks for clarifying it.

sgravrock commented 1 year ago

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.)