-
Notifications
You must be signed in to change notification settings - Fork 1.2k
NEW automatically set strong globalize to english when passing tests #3136
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
NEW automatically set strong globalize to english when passing tests #3136
Conversation
|
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
|
Can one of the admins verify this patch? |
3 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
@bajtos Sorry for the long commit name but I'm used to be explicit. I'll try to make the smaller next time |
|
Hello @pierreclr, thank you for the pull request! |
| var SG = require('strong-globalize'); | ||
|
|
||
| if (process.env.NODE_ENV === 'test') { | ||
| module.exports = SG({language: 'en'}); |
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.
@Setogit I am wondering, what environment variables should we change in our tests in order to force strong-globalize to use en language when running the test suite? I'd like to avoid this custom SG initialization used by our tests only.
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.
To set the default language, you can use two environment variables:
STRONGLOOP_GLOBALIZE_APP_LANGUAGE, or the OS-level local environment variable, e.g. LANG.
|
|
||
| grunt.registerTask('set-test-env', function() { | ||
| process.env.NODE_ENV = 'test'; | ||
| }); |
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 will not work when running the tests manually via mocha. I am proposing to use env-test module instead and configure the environment in test/mocha.opts.
|
Closing in favour of #3138 |
Description
This PR automatically set strong-globalize language to
enintestNODE_ENV.It also set this env before runing test through grunt task
Related issues
#3105