Git Product home page Git Product logo

Comments (4)

Romanchuk avatar Romanchuk commented on May 27, 2024

@WebStew Actually i have no unit tests for components that use i18next =(
The simpliest and easiest way (as i know) for any tests is to setup i18next with 'cimode' language.
https://www.i18next.com/how-to/faq

How to handle with changes in e2e tests?

For e2e tests a good tactic is to set language to cimode on init. This will set i18next to always return the key on calling i18next.t. Want to add the namespace to returned value change appendNamespaceToCIMode: true on init.

Or you can stub "ITranslationService" for achieve specific behavior.

from angular-i18next.

ArturKwiatkowski avatar ArturKwiatkowski commented on May 27, 2024

It would be super nice if you could throw an example spec for a component. I am still figuring this all out, maybe I'll propose a PR if I succeed.

from angular-i18next.

Romanchuk avatar Romanchuk commented on May 27, 2024

@WebStew @ArturKwiatkowski Hi! I just added exaple spec of in-project unit-testing
/tests/projectTests/projectTests.spec.ts

Hope, this will help you.

from angular-i18next.

tihomir-horvat-fadv avatar tihomir-horvat-fadv commented on May 27, 2024

@WebStew @ArturKwiatkowski Hi! I just added exaple spec of in-project unit-testing /tests/projectTests/projectTests.spec.ts

Hope, this will help you.

And this link is broken. I need to use this library as part of current project dependency, unfortunately there is no documentation for testing beside of this comment. Also It would be nice to have your code and examples covered with unit tests.

from angular-i18next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.