Skip to content

jordanwallwork/inline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Inline.js - Inline Testing in Javascript

Inline.js allows you to append unit tests onto function declarations inline in code, such as:

 var square = function(n) { return n * n; }.where(3).shouldEqual(9);

It was inspired by the article Extending JavaScript with inline unit tests by Sergi Mansilla, which uses macros to achieve a similar result.

Inline.js is only a quick experiment, and I wouldn’t really recommend mixing tests and code, but I do think there’s something interesting about inline testing, and could see it being used for teaching or demonstration purposes. Read more on my blog.

About

Inline unit tests in javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published