How to use the tape._methods 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;
            case "bubble":
github sugarcrm / sucrose / test / lib / twine.js View on Github external
register(assert, type) {
        let name = assert.name.match(/ - ([\w]*):/)[1];
        tape._methods[type] = tape._methods[type].filter(function(d) {
            return d !== name;
        });
    },