How to use the tape._missing function in tape

To help you get started, we’ve selected a few tape 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 sugarcrm / sucrose / test / lib / twine.js View on Github external
"use strict";

const tape = require("tape");
const tapes = require("tapes");
const addAssertions = require("extend-tape");
const sucrose = require("../fixtures/build/sucrose.js");

tape._missing = tape._missing || {};
tape._methods = tape._methods || {};
let _counter = 0;
let _left = 0;

// add a new assertions
const test = addAssertions(tape, {

    methods(type, exclusions) {
        let instance;
        let native = Object.getOwnPropertyNames(new Function());
        let common = ["dispatch"];
        let excluded = native.concat(common, exclusions);
        switch(type) {
            case "area":
                instance = sucrose.charts.areaChart();
                break;
github sugarcrm / sucrose / test / lib / twine.js View on Github external
report(type) {
        _counter -= 1;
        if (tape._methods[type].length) {
            tape._missing[type] = tape._methods[type];
            _left += tape._methods[type].length;
        }
        if (_counter === 0) {
            if (_left > 0) {
                console.log("===================\nPublic methods left: " + _left);
                console.log(tape._missing);
            } else {
                console.log("All public methods are covered!");
            }
        }
    },
});