node package manager

joe

Joe is a JavaScript testing framework that actually works. Unlike Mocha, we won't die on you abruptly when executing dynamically created tests and are always able to associate the correct test to the correct corresponding test suite. Switching from Mocha

Joe


Joe is a JavaScript testing framework that actually works. Unlike Mocha, we won't die on you abruptly when executing dynamically created tests and are always able to associate the correct test to the correct corresponding test suite. Switching from Mocha is trivial and only takes a few minutes.

Install

NPM

  • Install: npm install --save joe
  • Module: require('joe')
  • Browserify

    • Install: npm install --save joe
    • Module: require('joe')
    • CDN URL: //wzrd.in/bundle/joe@1.8.0
    • Ender

      • Install: ender add joe
      • Module: require('joe')
      • Editions

        This package is published with the following editions:

        • joe aliases joe/index.js which uses Editions to automatically select the correct edition for the consumers environment
        • joe/source/index.js is Source + ESNext + Require
        • joe/es2015/index.js is Babel Compiled + ES2015 + Require

        Older environments may need Babel's Polyfill or something similar.

        // define your test suite 
        require('joe').suite('suite name', function (suite, test) {
            // group together items into sub suites if you desire 
            suite('sub suite name', function (suite, test) {
                // create both synchronous and asynchronous tests 
                test('synchronous test', function () {
                    console.log('do your sync stuff')
                })
         
                test('asynchronous test name', function (complete) {
                    console.log('do your async stuff')
                    setTimeout(function () {
                        complete()
                    }, 500)
                })
         
                // run a methods before and\or after the test 
                function beforeEach(test) {
                    console.log('do some pre test stuff')
                }
                function afterEach(test, err) {
                    console.log('do some post test stuff')
                }
         
                test('before and after options test', {before: beforeEach, after: afterEach}, function () {
                    console.log('do your before and after stuff')
                })
            })
         
            // you can also define tests dynamically when using the completion callback on the group 
            suite('lets create dynamic tests', function (suite, it, done) {
                setTimeout(function () {
                    test('a synchronous dynamic test', function () {
                        console.log('do your sync stuff')
                    })
                    done()
                }, 500)
            })
        })
        $ node example.js
        suite name
        suite name ➞  sub suite name
        suite name ➞  sub suite name ➞  synchronous test
        suite name ➞  sub suite name ➞  synchronous test ✔   
        suite name ➞  sub suite name ➞  asynchronous test name
        suite name ➞  sub suite name ➞  asynchronous test name ✔   
        suite name ➞  sub suite name ✔  
        suite name ➞  lets create dynamic tests
        suite name ➞  lets create dynamic tests ➞  a synchronous dynamic test
        suite name ➞  lets create dynamic tests ➞  a synchronous dynamic test ✔   
        suite name ➞  lets create dynamic tests ✔  
        suite name ✔  
         
        3/3 tests ran successfully, everything passed

        View the Complete Joe Documentation on the Bevry Learning Centre

        Discover the available Custom Reporters for Joe using the joe-reporter keyword on the NPM Registry

        History

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

        Contribute

        Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

        Backers

        Maintainers

        These amazing people are maintaining this project:

        Sponsors

        No sponsors yet! Will you be the first?

        Contributors

        These amazing people have contributed code to this project:

        Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

        License

        Unless stated otherwise all works are:

        and licensed under: