Skip to content

Module import not found in Jest #65

Description

@ghooghe

Hello,
while using vue3-gettext (version 4.0.0-alpha.8), import { createGettext } from "vue3-gettext" in production code (vite build) works fine, while in the vue-test-utils environment I get an Cannot find module 'vue3-gettext' error.

Useful jest configuration:

"jest": {
...
"transform": {
      "^.+\\.vue$": "@vue/vue3-jest",
      "^.+\\.svg$": "jest-transform-stub",
      "^.+\\.js$": "babel-jest"
    },
"testEnvironmentOptions": {
      "customExportConditions": ["node", "node-addons"]
    },
...
}

I've copied the vue3-gettext.js source file in my app and the import is well found in the jest environment.
So, I guess my jest configuration is missing a flag.

Many thanks for your help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions