How to use the tap.equals function in tap

To help you get started, we’ve selected a few tap 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 YahooArchive / mendel / test / tree-variation-walker-server.js View on Github external
/* Copyright 2015, Yahoo Inc.
   Copyrights licensed under the MIT License.
   See the accompanying LICENSE file for terms. */

var t = require('tap');

var MendelServerVariationWalker = require('../packages/mendel-core/tree-variation-walker-server');

t.equals(MendelServerVariationWalker().constructor, MendelServerVariationWalker, 'constructor');

var stub1 = {
    index: 0,
    id: 'first',
    variations: ['a', 'b', 'special'],
    data: [
        {id:'a', sha:'ba', variation: 'a'},
        {id:'b', variation: 'b'},
        {id:'special', 'variation': 'special'},
    ],
};

var walker = MendelServerVariationWalker([['a'],['special']], 'special');
walker.find(stub1);
t.same(walker.found(),
    { first: 'a' },
github YahooArchive / mendel / test / tree-variation-walker.js View on Github external
/* Copyright 2015, Yahoo Inc.
   Copyrights licensed under the MIT License.
   See the accompanying LICENSE file for terms. */

var t = require('tap');

var MendelVariationWalker = require('../packages/mendel-core/tree-variation-walker');

t.equals(MendelVariationWalker().constructor, MendelVariationWalker, 'constructor');

var stub1 = {
    index: 0,
    id: 'first',
    variations: ['a', 'b', 'special'],
    data: [{id:'a', sha:'ba'},{id:'b'},{id:'special'}],
};

var walker = MendelVariationWalker([['a'],['special']], 'special');
var ret = walker._resolveBranch(stub1);

t.match(ret, {index:0, resolved:{id:'a'}},
    'returns first match');

t.match(walker.conflicts, 0,
    'no conflicts with base');
github YahooArchive / mendel / test / tree-walker.js View on Github external
/* Copyright 2015, Yahoo Inc.
   Copyrights licensed under the MIT License.
   See the accompanying LICENSE file for terms. */

var t = require('tap');

var MendelWalker = require('../packages/mendel-core/tree-walker');

var walker = MendelWalker();

t.equals(walker.constructor, MendelWalker, 'constructor');

var shallowModule = {
    id: 'root',
    index: 0,
    data: [{
        id: 'stubData',
        sha: '010203',
    }],
};

t.equals(walker.find(shallowModule).id, 'stubData',
    'Shallow module won\'t call _resolveBranch');

t.equals(walker.find({index:0}).id, 'stubData',
    'Caches result by index');
github YahooArchive / mendel / test / tree-variation-walker.js View on Github external
var walker = MendelVariationWalker([['a'],['special']], 'special');
var ret = walker._resolveBranch(stub1);

t.match(ret, {index:0, resolved:{id:'a'}},
    'returns first match');

t.match(walker.conflicts, 0,
    'no conflicts with base');

walker = new MendelVariationWalker([['nope'], ['b'],['special']], 'special');
ret = walker._resolveBranch(stub1);

t.match(ret, {index:1, resolved:{id:'b'}},
    'returns first match');

t.equals(walker.conflicts, 0,
    'no conflicts with base');

walker = new MendelVariationWalker([['a', 'b'],['special']], 'special');
ret = walker._resolveBranch(stub1);

t.equals(walker.conflicts, 0,
    'Two variations on the same level don\'t conflict');

walker = new MendelVariationWalker([['a'], ['b'],['special']], 'special');
ret = walker.find(stub1);

t.equals(walker.conflicts, 1,
    'detects conflicts');

t.match(walker.conflictList, {'first':true},
    'conflicts map');
github metarhia / jstp / test / node / session-resend-event-on-connection-drop.js View on Github external
function handleEvent(ifaceName, eventName) {
  test.equals(ifaceName, iface, 'interface name must match');
  test.equals(eventName, event, 'event name must match');
  client.kill();
  server.close();
}
github mreinstein / aws-transcription-to-vtt / test / basic.js View on Github external
{
                "alternatives": [
                    {
                        "confidence": null,
                        "content": "."
                    }
                ],
                "type": "punctuation"
            }
        ]
    },
    "status": "COMPLETED"
});


tap.equals(result,
`WEBVTT

1
00:00:07.840 --> 00:00:12.870
Wait.

`);
github metarhia / jstp / test / node / session-resend-event-on-connection-drop.js View on Github external
function handleEvent(ifaceName, eventName) {
  test.equals(ifaceName, iface, 'interface name must match');
  test.equals(eventName, event, 'event name must match');
  client.kill();
  server.close();
}
github mreinstein / aws-transcription-to-vtt / test / samples.js View on Github external
import fs         from 'fs';
import tap        from 'tap';
import vttConvert from '../index.js';


for (const sample of [ 'expert', 'se-radio' ]) {
    const json = JSON.parse(fs.readFileSync(__dirname + '/data/' + sample + '.json'));

    const vtt = fs.readFileSync(__dirname + '/data/' + sample + '.vtt', 'utf8');
    
    tap.equals(vtt, vttConvert(json));
}
github YahooArchive / mendel / test / tree-variation-walker.js View on Github external
t.match(ret, {index:1, resolved:{id:'b'}},
    'returns first match');

t.equals(walker.conflicts, 0,
    'no conflicts with base');

walker = new MendelVariationWalker([['a', 'b'],['special']], 'special');
ret = walker._resolveBranch(stub1);

t.equals(walker.conflicts, 0,
    'Two variations on the same level don\'t conflict');

walker = new MendelVariationWalker([['a'], ['b'],['special']], 'special');
ret = walker.find(stub1);

t.equals(walker.conflicts, 1,
    'detects conflicts');

t.match(walker.conflictList, {'first':true},
    'conflicts map');

t.match(walker.found(), {
  deps: [ { id: 'a', sha: 'ba' } ],
  hash: 'bWVuZGVsAQD_AQAGH7IIQx23k7vTZFt6FgWKHiokEg',
  conflicts: 1,
  conflictList: { first: true } },
'full result inherits from MendelWalker');