Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Testmatrix #37

Closed
jorgebucaran opened this issue Aug 15, 2018 · 0 comments
Closed

Use Testmatrix #37

jorgebucaran opened this issue Aug 15, 2018 · 0 comments
Assignees
Milestone

Comments

@jorgebucaran
Copy link
Owner

Switch to a declarative testing style where tests are represented as arrays of objects. See testmatrix.

exports.default = {
  "long options": [
    {
      name: "without value (boolean)",
      argv: ["--foo"],
      expected: {
        _: [],
        foo: true
      }
    },
    // ...
  ]
}

Instead of using the imperative approach common of tape/mocha/AVA, etc.

const test = require("tape")
const getopts = require("..")

test("long options", t => {
  t.deepEqual(getopts(["--foo"]), {
    _: [],
    foo: true
  }, "without value (boolean)")
  
  // ...

  t.end()
})
@jorgebucaran jorgebucaran self-assigned this Aug 15, 2018
@jorgebucaran jorgebucaran mentioned this issue Aug 15, 2018
@jorgebucaran jorgebucaran added this to the 2.2.0 milestone Aug 16, 2018
@jorgebucaran jorgebucaran changed the title Swap tape for testmatrix Use Testmatrix Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant