0.5.0 • Published 6 months ago

sjtest v0.5.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 months ago

SJTest: Simple Javascript Testing

TODO: currently publish to npm is broken (something around the 2FA setup not working?!).

SJTest provides easy-to-use unit & behaviour test tools for browser-based javascript.

If you write web-pages with javascript, then SJTest can help you to develop & maintain them.

10 Second Hello World

<html>
<head>
	<!-- You don't need jQuery or Bootstrap, but if they're present, we use them for nicer output. -->
	<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
	<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>

	<!-- SJTest.js -->
	<script src='https://rawgithub.com/winterstein/SJTest/master/SJTest.min.js'></script>
</head>
<body>
	<script>
		
		SJTest.run({name:'HelloWorld',

			easyTest: function() {
				assert(1+1 == 2);
			},

			failingTest: function() {
				assert(false, "Well that was never going to work");						
			}

		});

	</script>
</body>
</html>

Load this page in a browser -- adding SJTest=on to the url -- and you'll see this:

Try it now

Or from the command line, use PhantomJS to automate your testing:

phantomjs SJTest.js HelloWorld.html

TODO fix this (switching to npm broke it) E.g. here is how to run SJTest's own unit tests: phantomjs SJTest.js test/SJTestTest.html

That's it -- All you need to write and run tests! BUT SJTest has plenty of other useful features...

See the Project page, or the code, for more details.

0.5.0

6 months ago

0.4.9

5 years ago

0.4.8

6 years ago

0.4.7

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.2.0

8 years ago