1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【エラー解消】Jestでテスト実行時、identity-obj-proxyに関するエラーが発生した

Posted at

結論

npm install --save-dev identity-obj-proxyを実行する事で解消。

エラー

Configuration error:
    Could not locate module ../styles/RecordModal.css mapped as:
    identity-obj-proxy.

    Please check your configuration for these entries:
    {
      "moduleNameMapper": {
        "/\.(css|less)$/": "identity-obj-proxy"
      },
      "resolver": undefined
    }

    
  1 | import { Button, ModalBody, ModalContent, ModalFooter, ModalOverlay } from "@chakra-ui/react";
> 2 | import "../styles/RecordModal.css";

原因

jest.config.jsにmoduleNameMapperに関する設定を書いていたのに、npm installしていなかった。

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?