twada / qunit-tap Goto Github PK
View Code? Open in Web Editor NEWA TAP Output Producer Plugin for QUnit
License: GNU General Public License v2.0
A TAP Output Producer Plugin for QUnit
License: GNU General Public License v2.0
QUnit.test("some test", function(){ QUnit.equals(1, 2); });
outputs:
โค node test/some_test.js # test: some test not ok 1 - <span class="test-message">undefined</span>, expected: <span class="test-expected">2</span> result: <span class="test-actual">1</span>, diff: <del>2 </del><ins>1 </ins>
HTML code in a console is weird.
Hi twada,
Are we planning to release next version of qunit-tap with latest support of qunit anytime soon? Qunit is migrating to 2.x very soon, and we were planning to upgrade our libraries.
Hope to hear from you.
New QUnit and QUnit-tap user here. I've started adding some javascript to an existing perl CGI::Application web app. I put together a 'Hello, world' style of unit test based on what I read in your README, then added it to my existing test suites, and it failed because it had no plan.
$ prove t/suite.t
t/suite.t .. All 3 subtests passed
t/suite.t (Wstat: 0 Tests: 3 Failed: 0)
Parse errors: No plan found in TAP output
Files=1, Tests=3, 1 wallclock secs ( 0.03 usr 0.01 sys + 1.59 cusr 0.15 csys = 1.78 CPU)
Result: FAIL
In perl's TAP, you must provide a plan line, either at the front of the test, or at the end. By default, with Test::More, you specify the number of tests in the file when you initialize things. Test::More offers a 'no_plan' option where it will keep count for you and output the results at the end of the file, instead of at the beginning as normal.
With QUnit-tap, I'm not getting a plan line in the TAP output at all using the defaults (no_plan:false). I do get an output at the end when I use (no_plan:true.) My test file is specifying the number of tests to QUnit test(), and I've tried it both by passing the expected number to the test() function, and also by calling expects() inside the test. Both attempts failed to print a plan.
I would expect that, as QUnit itself knows what the expected number of tests in the file is, QUnit-tap should be printing this value as its first line of output, at the top of the test run. The no_plan idea from Perl's Test::More only moves the plan line to the end, after Test::More counts for you.
Not having any real experience with QUnit and QUnit-tap, I'm not sure what the intent is with this. In Perl, any script containing tests will output a plan either at the top or the bottom. Is QUnit-tap omitting the plan at the top because it's standard to specify multiple test() functions in a single file? (You might look at Test::Class for how that can be accomplished in a TAP manner in native perl.)
So, to summarize, in Test::More, 'no_plan' doesn't mean there is no plan output at all, it just means the test writer isn't going to provide the count, so Test::More will count and output the plan line at the end. QUnit-tap isn't replicating this behavior properly. QUnit-tap is failing to produce a TAP plan when no_plan is false.
npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url']
It would be great to have the choice between multiple output formats (comma-separated, newline, ...) and/or the ability to replace formatDetails
at all.
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.