Skip to content

How can I use Environment Veriables with Jest #193

@DarynHolmes

Description

@DarynHolmes

I would like to raise this issue again, as I have not been able to find an acceptable solution. If you feel it is not related to this project please close it and I will stop the pestering 😉

I am using environment variables as explained here: https://vuejs-templates.github.io/webpack/env.html

When I run vue-test-utils tests with Jest, the environment variables are not loaded. I believe this is because the tests don't use Webpack, please correct me if I am wrong.

I have created a project to show the issue: https://github.com/DarynHolmes/vue-jest-example

Use npm run unit to see the failing test.

Is there any recommended approach to solving this issue?

Again, sorry for the repost. If this is not the right project, could you please point me in the right direction?

Thanks, Daryn

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions