JSSpec User Guide
Install
Download JSSpec and unzip.
Open demo.html to see JSSpec running
Define new specification
- Create new HTML something like following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>JSSpec results</title> <link rel="stylesheet" type="text/css" href="JSSpec.css" /> <script type="text/javascript" src="diff_match_patch.js"></script> <script type="text/javascript" src="JSSpec.js"></script> <script type="text/javascript">// <![CDATA[ // Your spec goes here // ]]></script> </head> <body></body> </html>
Copy JSSpec.css, diff_match_patch.js and JSSpec.js into same directory
- Write your first spec:
<script type="text/javascript">// <![CDATA[ describe('Plus operation', { 'should concatenate two strings': function() { value_of("Hello " + "World").should_be("Hello World"); }, 'should add two numbers': function() { value_of(1 + 2).should_be(3); } }) // ]]></script> - Congratulations! You've just made specification for Javascript "+" operator.
Run and See
- Open your HTML to see your specification running
That's it. For more information, please see JSSpec/Manual