You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parser
options
1) generates one plural key for unknow languages
0 passing (11ms)
1 failing
1) parser
options
generates one plural key for unknow languages:
Uncaught AssertionError: expected { 'test {{count}}_one': '', …(2) } to deeply equal { 'test {{count}}_one': '', …(1) }
+ expected - actual
{
- "test {{count}}_many": ""
"test {{count}}_one": ""
"test {{count}}_other": ""
}
To Reproduce
$ yarn
$ yarn test
Expected behavior
Taking into consideration that I haven't changed anything in the codebase and I'm running it on the master branch, which is supposed to be the production-ready version, the test should run successfully.
272 passing (18s)
0 failing
Your Environment
runtime version: node v18
i18next version: ^23.5.1
i18next-parser version: 9.0.2
yarn version:: 1.22.22
os: Mac (M1)
The text was updated successfully, but these errors were encountered:
The problem is that we're doing a wrong test, testing the result of i18next.
1. The problem is on i18next in node environment
I've tested the i18next in node environment and the browser and got different results. I realized that the many possibility is coming only on node environment.
So if there is a compatibility issue, maybe it's necessary identify what's needs to be fixed to make it consistent on both environments. I know that it should not be executed on browser, but considering that the test is breaking in node environment that is the more common to be executed.
2. The problem is on the test
Considering that the many is not a problem, we would change the test to accept the many.
i18nextParser.once('end', () => {
assert.deepEqual(result, {
'test {{count}}_one': '',
'test {{count}}_many': '', // <- Add this to the assert
'test {{count}}_other': '',
})
done()
})
3. The problem is that we're doing a wrong test, testing the result of i18next.
Finally, we should question whether this test is necessary. Since this behavior is part of the i18next library, testing it here introduces unnecessary dependency on external behavior. The responsibility of pluralization lies with i18next, not our library. If there is an issue with i18next, the problem should be addressed within that library, not through our tests.
Conclusion
Let's discuss about these points and decide which solution fits better to this issue so that I can create a PR to sort it out.
🐛 Bug Report
Running the
yarn test
To Reproduce
$ yarn $ yarn test
Expected behavior
Taking into consideration that I haven't changed anything in the codebase and I'm running it on the master branch, which is supposed to be the production-ready version, the test should run successfully.
Your Environment
The text was updated successfully, but these errors were encountered: