NEW automatically set strong globalize to english when passing tests#3136
NEW automatically set strong globalize to english when passing tests#3136pierreclr wants to merge 1 commit intostrongloop:masterfrom pierreclr:FIX/strong-globalize-english-for-tests
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.
@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.
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.
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