philjackson / twerp Goto Github PK
View Code? Open in Web Editor NEWSuper simple, class based testing for twerps.
Super simple, class based testing for twerps.
Currently, the twerp
program has a --runner
parameter that is defined using OptionParser
as an enum
. The enum
is populated by a directory listing of lib/runner
. This assertion means that, in order to provide a customized test runner, an end user must place the customized runner in the Twerp library.
It would probably be better to allow the user to specify a runner external to Twerp.
Perhaps the --runner
parameter can accept a library path. The module would return a CustomRunner
class or a createRunner
method.
I'm writing a timezone, date format, date parse library in CoffeeScript. I'm using Twerp for testing. There are tests were I run through every day of the year for 70 years and check that the output of a library function matches cached output from GNU date
. This makes for a lot of dots on the command line, and it makes me have to scroll back to see if tests passed.
I'd like to see output that is line at a time. A progress indicator that updates itself on one line for a test and then moves onto the next test when it is complete.
When my twerp tests fail due to an exception, I'm expecting to see a stack trace. Instead, the twerp runner stops. With the tiny runner, using the following example, there is no output.
{TwerpTest} = require "twerp"
class exports.ATest extends TwerpTest
testSomething: (done) ->
a.b.c
done 0
It would be nice to get a stack trace and go on with the tests.
I've made a simple update to Twerp that permits natural language test names. Here is an example of the output, using the custom test runner I've created.
http://cloud.github.com/downloads/bigeasy/twerp/twerp120.png
I'd like to suggest that this modification be added to Twerp. It does not break existing tests or test runners.
Would be nice, if you could add a "styled" runner with more spaces and a bit more color.
For example, just change the following functions in progress.js:
Progress.prototype.onStartClass = function(suite) {
this.suite = suite;
return process.stderr.write("\033[33m\n " + suite + "\n");
};
Progress.prototype.onRunEnd = function(summary) {
process.stderr.write("\n\n");
process.stderr.write(" Time taken: " + summary.time + "\n");
process.stderr.write(" Passed: " + summary.passed + "\n");
return process.stderr.write(" Failed: " + summary.failed + "\n");
};
Thanks,
Joachim
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.