Skip to content

Fix/redo testing #129

@Steve0Greatness

Description

@Steve0Greatness

Testing is useful in a project like this to help to prevent bugs and regressions caused by changes. At this current moment in time, a good chunk of unit and all integration tests are broken.

Integration tests appear to be broken due to the testing tool (Node TAP) not being properly configured for Webpack (somehow). Whereas most broken unit tests are broken because they're attempting to access browser APIs (mainly window and location, but DOMParser is an issue in one part).


location (aliased as window.location) is referenced inside of src/extension-support/extension-manager.js

https://github.com/PenguinMod/PenguinMod-vm/blob/develop/src/extension-support/extension-manager.js#L11-L13

Whereas window is being referenced throughout src/util/sandboxed-javascript-runner.js.

DOMParser is used in src/engine/adapter.js.

https://github.com/PenguinMod/PenguinMod-vm/blob/develop/src/engine/adapter.js#L170-L183

Node TAP may not be compatible with these APIs, as it appears to be focused mainly on Node rather than the browser. I don't think the solution is to remove the browser APIs, the solution, instead, is to find an appropriate testing environment that can and will work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions