-
-
Notifications
You must be signed in to change notification settings - Fork 13
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 ✨] Configuration params through console #320
base: main
Are you sure you want to change the base?
Conversation
1e2b29f
to
b668ab2
Compare
Code Climate has analyzed commit f432926 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 98.6% (50% is the threshold). This pull request will bring the total coverage in the repository to 98.2% (0.0% change). View more on Code Climate. |
/** | ||
* I transform a list of console parameters into a valid configuration object. | ||
* I can also differentiate between path parameters and configuration parameters. | ||
*/ |
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.
For this comment to be JSdoc, it has to be placed before line 8
isFailFastParam, | ||
isRandomizeParam, | ||
isLanguageParam, |
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.
Let's move these three functions outside of utils. My idea of the utils module is to put logic that does not belong to the testy domain.
What about moving them to the ParametersParser module?
|
||
Una suite de test no es más que un archivo cuyo nombre finaliza con `_test.js` y tiene la siguiente forma: | ||
|
||
```javascript | ||
import { suite, test, assert } from '@pmoo/testy'; | ||
import { suite, test, assert } from "@pmoo/testy"; |
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.
This file has a lot of changes that seem to be automatic. Could we revert them and keep only the new changes?
*/ | ||
import { isFailFastParam, isLanguageParam, isRandomizeParam } from '../utils.js'; | ||
|
||
const LANGUAGE_OPTIONS = ['es', 'en', 'it']; |
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.
Right now, the list of available languages is dynamic. It depends on the locale files you create (see I18n::supportedLanguages
). Would it be possible to keep this list dynamic?
} | ||
|
||
static handle(configurationParam) { | ||
throw new Error(`Cannot parse invalid run configuration parameter ${configurationParam}. Please run --help option to check available options.`); |
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.
💟 for this empathetic message
What
Adding the ability of sending configuration parameters when running a test through the console. The introduced parameters are:
-f
or--fail-fast
commands-r
or--randomize
commands-l en/es/it
or--language en/es/it
commandsThese commands can be combined using either their long or short versions and in any order.
Validations and examples:
Running a single test using no config, fail fast enabled, randomize enabled, Italian language enabled and the combination of them 3
Running multiple tests paths sending a configuration
Running all tests sending a configuration
Link to issue(s)
Contribution guidelines