Next: , Previous: , Up: Source Tree   [Contents]

A.4 Test Directory

The test/ directory contains all the unit tests for the project. ease.js follows a test-driven development model; every single aspect of the framework is tested to ensure that features work as intended both server-side and across all supported web browsers. The tests also serve as regression tests, ensuring that bugs are not introduced for anything that has been covered. These tests should also give outside developers confidence; if a developer makes a modification to ease.js and does not cause any failing tests, it’s likely that their change didn’t have negative consequences on the integrity of the framework.

ease.js is currently in a transition period in regards to the style of the test cases. Tests written in the original format are prefixed with ‘test-’, followed by the name of the module, followed optionally by the specific part of the module that is being tested. Newer test cases are prefixed with the prototype name of the unit being tested, followed by ‘Test.js’. If there are a number of test cases for a given prototype, any number of tests will be included (with the same suffix) in a directory with the same name as the prototype. The tests are written in JavaScript and use Node.js’s assert module. Newer tests use a test case system that was developed to suit the needs of the project (still using the assert module). They may be run individually or all at once during the build process.

Developers interested in contributing to ease.js can aid in this transition process by helping to move all test-* tests over to the new test case format.

In addition, there exists a test/perf/ directory that contains performance tests used for benchmarking.

Next: , Previous: , Up: Source Tree   [Contents]