Description
SpeckJS is a tool for comment-driven development in JavaScript. You write plain comments above a function that describe example inputs and expected results, and SpeckJS converts those comments into full test spec files. The idea is to start test-driven development on a new project, or to add unit tests to an existing one without writing them by hand. It is installed as an npm module, and there are plugins for the grunt and gulp task runners. The site shows a short example in which a comment saying that sum(1, 2) equals 3 becomes a test spec for a sum function. Once the build step is set up, running the tool writes the spec files into a folder such as a test directory. The source code is hosted on GitHub. It suits JavaScript projects that already use npm and a task runner.…
Highlights
- Write test cases as plain comments next to your code
- Generates full test spec files from those comments
- npm module plus grunt and gulp plugins
- Helps add unit tests to existing projects
- Source code hosted on GitHub
Ratings & Reviews
No ratings yet
Be the first to rate SpeckJS.
People also visit

momentic-spec
Improve code correctness using Momentic specs in the feature development process
SpeckJS FAQ
What is SpeckJS?
SpeckJS is a JavaScript tool that turns comments in your code into test spec files, so you can write tests in comments next to the function they cover.
How do I install it?
Run npm install speckjs --save in your project directory. If you use grunt or gulp, install the grunt-speckjs or gulp-speckjs plugin instead and enable it in your Gruntfile or gulpfile.
What does a comment look like?
A comment starts with a marker such as // test followed by a function name, and each // # line gives an input and the expected result, for example sum(1, 2) == 3.
Who is it for?
Developers starting test-driven development on a new JavaScript project, or adding unit tests to an existing one.
Where is the source code?
The project is hosted on GitHub at github.com/speckjs/speckjs.
What are the best SpeckJS alternatives?
Popular alternatives to SpeckJS include Spearmint, Jsdoc and Nightwatch.js. See all SpeckJS alternatives

















