Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests to help catch regressions #104

Closed
parasyte opened this issue Sep 9, 2012 · 4 comments
Closed

Add unit tests to help catch regressions #104

parasyte opened this issue Sep 9, 2012 · 4 comments
Labels
Milestone

Comments

@parasyte
Copy link
Collaborator

parasyte commented Sep 9, 2012

The code is really well-laid out already, so it shouldn't be much work to make it testable. Some thoughts:

  • The testing may need to be done in-browser, because of the dependency on the canvas element. JsUnit should work for that.
  • Testing should also be possible (at least mostly) in Node.js, without a browser. JsUnit is not the right choice for this.
  • The testing framework should support asynchronous tests; melonJS is asynchronous by its very nature of being a game engine.
  • The testing framework must be extensible enough to support custom assertions. For example, an assertion that compares a canvas context to a pre-rendered "expected" image.

I found such a framework that will probably work great, called Tree.js. It has an excellent architecture and documentation. It was also designed with asynchronous assertions in mind, which is imperative for us. And [not documented but] it can be very easily extended with custom assertions.

@parasyte
Copy link
Collaborator Author

This will especially become important when working on #101, I think. And also #96, because I don't do a lot of testing with isometric maps (actually none!) Having automated tests would be really, really, really nice for these areas.

@melonjs
Copy link
Collaborator

melonjs commented Sep 11, 2012

Linking as well with ticket #80 and #47, which is about using grunt for the build system and enable Lint for code checking, and since it is about ensuring a clean code and avoid regression again (through Lint)

@obiot
Copy link
Member

obiot commented Nov 7, 2013

re-tagging to 1.0.0 as jasmine has been added

@obiot
Copy link
Member

obiot commented Nov 26, 2013

i'm closing this one as we now have some basic test unit using Jasmine.

These test units will have to be completed over the time, but at least we have the first step and basic bricks set up in the main branch

@obiot obiot closed this as completed Nov 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants