Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when running tests, I get a warning #205

Open
chiptus opened this issue Feb 7, 2022 · 0 comments
Open

when running tests, I get a warning #205

chiptus opened this issue Feb 7, 2022 · 0 comments

Comments

@chiptus
Copy link

chiptus commented Feb 7, 2022

Describe the bug

when running tests using jest, I get the following warning:

babel-plugin-i18next-extract: Extraction error in $REPO/node_modules/jwt-decode/build/jwt-decode.cjs.js at line 1. Couldn't evaluate i18next key. You should either make the key evaluable or skip the line using a skip comment (/* i18next-extract-disable-line */ or /* i18next-extract-disable-next-line */).

test pass, but I would love to remove this warning.

How to reproduce

Babel configuration:

module.exports = {
  plugins: ['lodash', 'angularjs-annotate', ['i18next-extract', { outputPath: 'translations/{{locale}}/{{ns}}.json' }]],
  presets: [
    [
      '@babel/preset-env',
      {
        useBuiltIns: 'usage',
        corejs: '3',
        targets: { node: 'current' },
        modules: 'auto',
      },
    ],
  ],
  overrides: [
    {
      test: ['app/**/*.ts', 'app/**/*.tsx'],
      presets: [
        '@babel/preset-typescript',
        [
          '@babel/preset-react',
          {
            runtime: 'automatic',
          },
        ],
        [
          '@babel/preset-env',
          {
            modules: 'auto',
            useBuiltIns: 'usage',
            corejs: '3',
          },
        ],
      ],
    },
  ],
};

Your environment

  • OS (e.g. ArchLinux): Ubuntu 20.04.1
  • Plugin version (e.g. 0.3.0): 0.8.3
  • Node version (e.g. 12.13.0): 16.13.2

Additional context
jest config:

{
    "clearMocks": true,
    "coverageProvider": "v8",
    "globalSetup": "<rootDir>/app/setup-tests/global-setup.js",
    "moduleNameMapper": {
        "\\\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/app/__mocks__/fileMock.js",
        "\\\\.(css|less)$": "<rootDir>/app/__mocks__/styleMock.js",
        "^@/(.*)$": "<rootDir>/app/$1"
    },
    "roots": [
        "<rootDir>/app"
    ],
    "setupFilesAfterEnv": [
        "<rootDir>/app/setup-tests/setup-msw.ts"
    ],
    "testEnvironment": "jsdom",
    "transformIgnorePatterns": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant