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
101 stars 164 forks source link

Ace editor warning in test suite #2962

Closed chownces closed 1 month ago

chownces commented 2 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