GithubHelp home page GithubHelp logo

tap-json's Introduction

tap-json

JSON TAP output formatter.

Installation

npm install -g tap-json
npm install tap-json --save-dev

Usage

tape test/*.js | tap-json
node test.js | ./node_modules/tap-json/bin/tap-json

Output

tap-json

tap-json

{
  "stats": {
    "asserts": 4,
    "passes": 2,
    "failures": 2
  },
  "asserts": [
    {
      "number": 1,
      "comment": "1 === 1",
      "name": "should be equal",
      "ok": true,
      "extra": {}
    },
    {
      "number": 2,
      "comment": "2 === 2",
      "name": "should be equal",
      "ok": true,
      "extra": {}
    }
    {
      "number": 3,
      "comment": "1 === 2",
      "name": "should be equal",
      "ok": false,
      "extra": {
        "operator": "equal",
        "expected": "2",
        "actual": "1"
      }
    },
    {
      "number": 4,
      "comment": "2 === 1",
      "name": "should be equal",
      "ok": false,
      "extra": {
        "operator": "equal",
        "expected": "1",
        "actual": "2"
      }
    }
  ]
}

License

The MIT License (MIT)

Copyright (c) 2014 Ellen Gummesson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

tap-json's People

Contributors

gummesson avatar michaelrhodes 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

Watchers

 avatar  avatar

tap-json's Issues

where assert

when I use ava --tab, the assert detail as follow

---
    operator: ===
    expected: 0
    actual: 202
    at: Test.<anonymous> (spec/my-code.js:34:5)
  ...

but, the tap-json just record as

{
    "extra": {
        "operator": "undefined",
        "expected": "undefined",
        "actual": "undefined"
    }
}

why didn't add the at info to extra ?

No AVA compatibility

AVA --tap option is not having assertions for operators, it produces most of the time name, message, and at

The input was this:

TAP version 13
# suite › browser › signin › signin.ad › [monitoring, cr7] Active Directory User - Rejected when user is disabled in AD
not ok 1 - suite › browser › signin › signin.ad › [monitoring, cr7] Active Directory User - Rejected when user is disabled in AD
  ---
    name: AssertionError
    message: Rejected promise returned by test
    values:
      'Rejected promise returned by test. Reason:': |-
        Error {
          message: 'No node found for selector: button[type=submitsss]',
        }
    at: 'assert (node_modules/puppeteer/lib/helper.js:231:11)'
  ...

1..1
# tests 1
# pass 0
# fail 1

producing an empty extra

Now the output is:

{"stats":{"asserts":1,"passes":0,"failures":1},"asserts":[{"number":1,"comment":"suite › browser › signin › signin.ad › [monitoring, cr7] Active Directory User - Rejected when user is disabled in AD","name":"suite › browser › signin › signin.ad › [monitoring, cr7] Active Directory User - Rejected when user is disabled in AD","ok":false,"extra":{}}]}

Confused about purpose

@gummesson

I am confused about the purpose of this package. Maybe in the readme can you add some details about what this package does and who its intended audience is?

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.