tailieunhanh - Phát triển Javascript - part 8

Tham khảo tài liệu 'phát triển javascript - part 8', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | One Test Runner to Rule Them All 43 frameworks are easier to work with but fail at testing in the actual environment the code will be running in reducing their usefulness as testing tools. A fairly new player on the field of xUnit testing frameworks is JsTestDriver originating from Google. In contrast to the traditional frameworks JsTestDriver is first and foremost a test runner and a clever one at that. JsTestDriver solves the aforementioned problems by making it easy both to run tests and to test widely in real browsers. How JsTestDriver Works JsTestDriver uses a small server to run tests. Browsers are captured by the test runner and tests are scheduled by issuing a request to the server. As each browser runs the tests results are sent back to the client and presented to the developer. This means that as browsers are idly awaiting tests we can schedule runs from either the command line the IDE or wherever we may feel most comfortable running them from. This approach has numerous advantages Tests can be run in browsers without requiring manual interaction with the browser. Tests can be run in browsers on multiple machines including mobile devices allowing for arbitrary complex testing grids. Tests run fast due to the fact that results need not be added to the DOM and rendered they can be run in any number of browsers simultaneously and the browser doesn t need to reload scripts that haven t changed since the tests were last run. Tests can use the full DOM because no portion of the document is reserved for the test runner to display results. No need for an HTML fixture simply provide one or more scripts and test scripts an empty document is created on the fly by the test runner. JsTestDriver tests are fast. The test runner can run complex test suites of several hundred tests in under a single second. Because tests are run simultaneously tests will still run in about a second even when testing 15 browsers at the same time. Granted some time is spent .

TỪ KHÓA LIÊN QUAN