source-academy / frontend

Frontend of Source Academy, an online experiential environment for computational thinking (React, Redux, Saga, Blueprint)
https://sourceacademy.org
Apache License 2.0
103 stars 167 forks source link

Ace editor warning in test suite #2962

Closed chownces closed 6 months ago

chownces commented 6 months ago

There is currently some acequire import issue in ace-builds when running the test suite, where the following are undefined in the test environment:

https://github.com/source-academy/frontend/blob/00d49de693f8332e484355b35d24f2cb29927da0/src/commons/editor/Editor.tsx#L673

https://github.com/source-academy/frontend/blob/00d49de693f8332e484355b35d24f2cb29927da0/src/commons/editor/Editor.tsx#L445

Thus, acequire is currently being mocked in the test suite in AssessmentWorkspace and Playground where the tests render the Ace editor. However, these mocks result in the following console warning as the actual Ace editor is not initialized properly:

image

TODO: Let's debug the root cause and fix the acequire import issue