3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Jest】VeeValidateのSyntaxError: Unexpected token 'export'を回避する

Posted at

【Jest】VeeValidateのSyntaxError: Unexpected token 'export'を回避する

error
    export { alpha$1 as alpha, alpha_dash, alpha_num, alpha_spaces, between, confirmed, digits, dimensions, email, excluded, ext, image, integer, is, is_not, length, max, max_value, mimes, min, min_value, numeric, oneOf, regex, required, required_if, size };
    ^^^^^^

    SyntaxError: Unexpected token 'export'

      4 | } from 'vee-validate'
      5 | import ja from 'vee-validate/dist/locale/ja'
    > 6 | import * as rules from 'vee-validate/dist/rules'
        | ^

以下のignore pattern を追加することで解決します。

jest.config.js
module.exports = {
  transformIgnorePatterns: ['/node_modules/(?!vee-validate/dist/rules)'],
}
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?