I am attempting to execute a basic Mocha unit test for code that utilizes the Vector3 class from THREE.js:
import {Vector3} from 'three';
const a = new Vector3(0, 0, 0);
When running this test using Mocha (specifically mocha-webpack, with webpack targeting 'node' instead of 'web'), I encounter the following error:
RUNTIME EXCEPTION Exception occurred while loading your tests
ReferenceError: THREE is not defined
It's puzzling because I haven't referenced the name THREE in my test code. THREE is actually a (global?) object defined within the source code of three.js, but for some reason, it's not accessible now. How can I modify the test code above to make it functional?