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

Write test scripts #59

Open
hal255 opened this issue Nov 22, 2018 · 1 comment
Open

Write test scripts #59

hal255 opened this issue Nov 22, 2018 · 1 comment

Comments

@hal255
Copy link
Collaborator

hal255 commented Nov 22, 2018

Initial proposal for test suite (definitely not final):

  • separate folder (client/js/tests)
  • separate test files for testing separate js files, examples:
    • testBoot.js will test boot.js
    • testGameLoop.js will test gameLoop.js
    • etc...
  • In each [test].js, test for following:
    • Functional Tests (test end points)
      • example: assert neutralMap.getMapSpeed is equal to config.neutralmap.speed
      • example2: change value of config.neutralmap.speed, then assert neutralMap.getMapSpeed is equal to config.neutralmap.speed
      • example3: call neutralMap.changeMapSpeed(5), then assert neutralMap.getMapSpeed is equal to config.neutralmap.speed + 5
      • all of the above examples would be included, since the goal is to test for EVERYTHING
@hal255
Copy link
Collaborator Author

hal255 commented Nov 22, 2018

Incorporated unit.js library into project. As a result, there exists a global variable "unitjs" which we can use to call assert functions.

Example: Comparing if two values are equal

  • (in code) >>> unitjs.assert.equal(value1, value2, "My Error Message!!!");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant