Quantcast
Channel: Chutzpah - A JavaScript Test Runner
Viewing all articles
Browse latest Browse all 1864

Commented Feature: Customizable HTML Harnesses [124]

$
0
0
Chutzpah is a more effective test runner when you can run directly on your js/coffee/ts files however for some scenarios (like with AMD) you want more control and need to author your own test harness file. To bridge this gap Chutzpah should provide a test harness template feature.

Using this you will be able to specify in your chutzpah.json a path to a test harness template. In this template you will be able to tell Chutzpah where to put the test files, js files etc. For example this is currently what Chutzpah uses internally for a qunit HTML test harness template:

```
<!DOCTYPE html>
<html>
<head>
@@TestFrameworkDependencies@@
@@ReferencedCSSFiles@@
@@ReferencedJSFiles@@
@@TestJSFile@@
</head>

<body>
<h1 id="qunit-header">Unit Tests</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture"></div>
</body>
</html>

```
The words with @@ around them are placeholders that Chutzpah fills in for you. I think this method will allow people to have full customizablity and still get the benefits of running on JS files.
Comments: The customizable test harness feature has been released in [version 3.0](http://matthewmanela.com/blog/chutzpah-3-0-mocha-requirejs-and-more/)

Viewing all articles
Browse latest Browse all 1864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>