Giter VIP home page Giter VIP logo

qunit-tap's People

Contributors

cside avatar kompiro avatar nv avatar twada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qunit-tap's Issues

HTML output in a console

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.

I use qunitjs/qunit@c6d66aa91ad72b2ec8a8

No support for qunit 1.15 & 1.16?

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.

  • Bijoy

No test plan gets printed

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

Test Summary Report

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.