LoginSignup
TEISHOTOKU-P
@TEISHOTOKU-P (低所得 -P)

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

ReferenceError fabric is not defined :Jestでfabric.jsを利用したソースコードをテストするとエラーになる

解決したいこと

プログラミング初心者です。
現在 jest を利用してfabric.jsを使ったソースプログラムをテストしようとしているのですが、
npm run jestを実行すると、(package.jsonのscriptsにjestを定義してる)
以下のように表示されてしまいます。
どなたか教えていただけますでしょうか。

Test suite failed to run
ReferenceError: fabric is not defined

エラーの原因のソースコードはこちらです。

const fabric = require('./fabric.min');
0

1Answer

Comments

  1. @TEISHOTOKU-P

    Questioner
    回答ありがとうございます。
    試してみましたが、同じエラーが生じました。

Your answer might help someone💌