Giter Site home page Giter Site logo

bevry / kava Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 14.0 1.17 MB

Kava has been powering accurate test suites in node.js and the browser since 2012.

Home Page: https://kava.bevry.me

License: Other

JavaScript 100.00%
node test-framework joe-test builtwith-taskgroup test-runner client-side

kava's Introduction

kava

Status of the GitHub Workflow: bevry NPM version NPM downloads
GitHub Sponsors donate button ThanksDev donate button Patreon donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button
Discord server badge Twitch community badge

Kava has been powering accurate test suites for Node.js and Web Browsers since 2012.

Usage

Complete API Documentation.

Guides & Documentation.

Install

  • Install: npm install --save kava
  • Import: import * as pkg from ('kava')
  • Require: const pkg = require('kava')
<script type="module">
    import * as pkg from '//dev.jspm.io/[email protected]'
</script>

This package is published with the following editions:

  • kava aliases kava/index.cjs which uses the Editions Autoloader to automatically select the correct edition for the consumer's environment
  • kava/source/index.js is ESNext source code for Node.js 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules
  • kava/edition-browsers/index.js is ESNext compiled for web browsers with Require for modules
  • kava/edition-node-6/index.js is ESNext compiled for Node.js 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with Require for modules
  • kava/edition-node-4/index.js is ESNext compiled for Node.js 4 with Require for modules
  • kava/./index.d.ts is ESNext compiled Types with Require for modules

This project provides its type information via inline JSDoc Comments. To make use of this in TypeScript, set your maxNodeModuleJsDepth compiler option to 5 or thereabouts. You can accomplish this via your tsconfig.json file like so:

{
  "compilerOptions": {
    "maxNodeModuleJsDepth": 5
  }
}

History

Discover the release history by heading on over to the HISTORY.md file.

Backers

Code

Discover how to contribute via the CONTRIBUTING.md file.

Authors

Maintainers

Contributors

Finances

GitHub Sponsors donate button ThanksDev donate button Patreon donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button

Sponsors

  • Andrew Nesbitt — Software engineer and researcher
  • Balsa — We're Balsa, and we're building tools for builders.
  • Codecov — Empower developers with tools to improve code quality and testing.
  • Poonacha Medappa
  • Rob Morris
  • Sentry — Real-time crash reporting for your web apps, mobile apps, and games.
  • Syntax — Syntax Podcast

Donors

License

Unless stated otherwise all works are:

and licensed under:

kava's People

Contributors

balupton avatar dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar pflannery avatar rdeforest 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

Watchers

 avatar  avatar  avatar  avatar

kava's Issues

Feature Request: global or suite-wide test timeouts

It would be quite useful, especially when dealing with integration testing, if there was an easy way to say "every test should complete within X seconds", either on a global or per-suite basis. If the timeout expires before the completion callback is called, the test fails.

You can do this right now with an explicit setTimeout inside each test, but that needs to be repeated in each test.

JSDocs

Would be cool to add JSDocs to Joe

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

The property '#/update_configs/0/automerged_updates/0/match/update_type' value "security" did not match one of the following values: all, security:patch, semver:patch, semver:minor, in_range

Please update the config file to conform with Dependabot's specification using our docs and online validator.

List reporter not working as advertised

Looks like whatever constructs the path to alternative reporters is incorrectly including 'console':

$ KAVA_REPORTER=console node -e '(require("kava")).test("must pass", () => true)'
must pass
must pass ✔

1/1 tests ran successfully, everything passed

$ KAVA_REPORTER=list node -e '(require("kava")).test("must pass", () => true)'
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module './reporters/console/list.js'
Require stack:
- /home/robert/node_modules/kava/source/index.js
- /home/robert/kava-bug-demo/[eval]
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.addReporter (/home/robert/node_modules/kava/source/index.js:708:17)
    at Object.getReporters (/home/robert/node_modules/kava/source/index.js:581:12)
    at Object.report (/home/robert/node_modules/kava/source/index.js:741:29)
    at Object.exit (/home/robert/node_modules/kava/source/index.js:784:8)
    at process.<anonymous> (/home/robert/node_modules/kava/source/index.js:856:10)
    at process.emit (node:events:406:35) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/robert/node_modules/kava/source/index.js',
    '/home/robert/kava-bug-demo/[eval]'
  ]
}

node 0.8 issue -> ReferenceError: setImmediate is not defined

The latest version of TaskGroup (3.3.4) has broken Joe for node 0.8 tests because "setImmediate is not defined".

I believe this is because Joe is using a "Reasonably close version" dependency with taskGroup package.json entry here

It maybe best to change the way Joe depends on taskgroup or another option is to set taskGroup to version 4.0.0 and unpublish version 3.3.4?

Possible to suppress describe fn log output?

Is it possible to suppress the describe() log output?

i.e.below lines 2, 4, 6, 8 would not show

1.sayHello
2.sayHello > when the message is undefined
3.sayHello > when the message is undefined OK
4.sayHello > when the message has text
5.sayHello > when the message has text OK
6.sayHello > throws an error
7.sayHello > throws an error OK
8.sayHello > stores the text
9.sayHello > stores the text OK
10.sayHello OK

Evaluate TaskGroup v5's destroyOnceDone

Should the global suite have destroyOnceDone enabled or disabled? This should allow exit to correctly fire on browser environments, where no process.exit is emitted - however, it may already do so, just multiple times, which is also acceptable. This needs to be revaluated when #17 is done.

Add complete browser testing suite

Currently browser testing is performed manually. Certain things like displaying errors accordingly differ based on browser vs console (console reporter outputs them on suite or test finish if browser, can't remember which one, as well as exit). Colours should differ based on browser vs console. Exit may or may not run in browser setups (was the case pre taskgroup v5, unsure if is still an occurrence with taskgroup v5).

How to specify setup/teardown code?

I couldn't find any example in 'src/examples'.

I'm considering migrating my projects from mocha to your framework due the 'wait for tests' feature, but I really need suite?{setup,teardown}.

I could probably emulate suiteSetup/suiteTeardown using standard tests at the beginning/end of the suite but that would not be cool since it would show in the report.

Also, setup/teardown(run before/after each test) is a must for me.

Not exiting with the right status code on latest version

https://travis-ci.org/bevry/docpad/jobs/10869898

docpad-render ➞  stdin
docpad-render ➞  stdin ➞  markdown without extension
docpad-render ➞  stdin ➞  markdown without extension ✘   
docpad-render ➞  stdin ✘  
docpad-render ✘  
FAILURE: 59/60 tests ran successfully; 1 failed, 0 incomplete, 1 errors
Error #1:
docpad-render ➞  stdin ➞  markdown without extension
Error: exited with a non-zero status code
    at ChildProcess.<anonymous> (/home/travis/build/bevry/docpad/node_modules/safeps/out/lib/safeps.js:154:21)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Process.ChildProcess._handle.onexit (child_process.js:802:5)
The command "./node_modules/.bin/cake test" exited with 0.
Done. Your build exited with 0.

Way for a failing suite to not kill the process?

I'm working on a fairly large project, and we have to split our tests across multiple files and suites to maintain our sanity.

In playing with joe, it makes it possible to do this in a variety of different ways, and that's cool, but I'm dealing with one thing that I think may be a problem: if a test fails in a suite, it kills the entire process.

I'd really like if there was some way to configure things so that if a suite fails, that suite fails but other suites can still go ahead and run, and get a consolidated list of failures at the end.

Streams based reporting

Could help with bevry-archive/joe-reporter-console#2

Concerns are that you don't want user code piping to stdout, as multiple files could repeat the pipe. So there will still need to be the concept of default reporters or some sort, but then how would a default reporter help with piping as pipes can be multiple nests deep - e.g. joe could write JSON data in the form of {event, ...}, that then is piped to the console stream, which is then piped to the browser-console-colors stream, which is then piped to stdout.

Perhaps reporters should handle the streams. Need to think about this.

Your .dependabot/config.yml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yml:

The property '#/update_configs/0/automerged_updates/0/match/update_type' value "security" did not match one of the following values: all, security:patch, semver:patch, semver:minor, in_range

Please update the config file to conform with Dependabot's specification using our docs and online validator.

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.