-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Allow testem to run specific test module #2532
Conversation
Adds `--module` command line option to `ember test` and `ember test --server`. The `--module` option tells QUnit to run the specified test module. Example usage `ember test --module "Module Name Here"`
Nice work on this Jarrod! +1 |
|
||
var tmpPath = this.quickTemp.makeOrRemake(this, '-customConfigFile'); | ||
var customPath = path.join(tmpPath, 'testem.json'); | ||
var originalContents = JSON.parse(fs.readFileSync(options.configFile, { encoding: 'utf8' })); | ||
|
||
originalContents['test_page'] = originalContents['test_page'] + '?filter=' + options.filter; | ||
if (options.filter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to build up te query string. You should be able to use BOTH filter and module.
This looks great! Needs a slight tweak to allow both filter and module at the same time. Along with a test confirming. |
👍 |
3 similar comments
👍 |
👍 |
👍 |
I was unaware that the QUnite syntax allowed both |
This allows testing a specific module for all tests containing a given string. Example usage all tests in the `fooModule` containing the word `bar` `ember test --module "fooModule" --filter "bar"`
It now accepts both If anyone has a more elegant way to implement this just let me know. |
Not sure what is up with the failing build for 0.10.18 Travis says 0.11 is green and 0.10.X passes locally. |
rerunning, looks like travis may have broke |
|
||
var tmpPath = this.quickTemp.makeOrRemake(this, '-customConfigFile'); | ||
var customPath = path.join(tmpPath, 'testem.json'); | ||
var originalContents = JSON.parse(fs.readFileSync(options.configFile, { encoding: 'utf8' })); | ||
|
||
originalContents['test_page'] = originalContents['test_page'] + '?filter=' + options.filter; | ||
if (options.module && options.filter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, something like:
var params = [];
if (options.module) {
params.push('module=' + options.module);
}
if (options.filter) {
params.push('filter=' + options.filter);
}
originalContents['test_page'] = originalContents['test_page'] + '?' + params.join('&');
👍 thanks Jarrod |
@rwjblue I like it. Thanks for sticking with me on this one. |
Feature: Allow testem to run specific test module
Awesome! Thank you! |
Trying to use this to run a test I am writing. Can't figure out how to call it properly though. Could someone please give a quick concrete example? I have a test file "/tests/unit/components/image-upload-test.js".
Thank you. |
Looks like I figured it out. I had to run the following command.
|
@rchrd2 - |
😍 |
Adds
--module
command line option toember test
andember test --server
. The--module
option tells QUnit to run the specified test module.Example usage
ember test --module "Module Name Here"