How to use the bocha.testCase function in bocha

To help you get started, we’ve selected a few bocha examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arnesten / smartdb / test / find.tests.js View on Github external
let { testCase, assert } = require('bocha');
let nock = require('nock');
let SmartDb = require('../lib/SmartDb.js');

module.exports = testCase('find', {
    setUp() {
        this.nock = nock('http://myserver.com');
    },
    tearDown() {
        nock.cleanAll();
    },
    'can find with explicit selector': async function () {
        this.nock
            .post('/animals/_find', {
                selector: {
                    name: 'Great white',
                },
                use_index: 'byName'
            })
            .reply(200, {
                docs: [

bocha

Bringing the best of Buster.js to Mocha

MIT
Latest version published 1 month ago

Package Health Score

57 / 100
Full package analysis