How to use the tape.only 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 audiojs / audio / test / core.js View on Github external
t('Caching resource', t => {
	let a = Audio('./chopin.mp3').on('load', (audio) => {
	})

	let b = Audio('./chopin.mp3').on('load', (audio) => {
	})

	assert.equal(Object.keys(Audio.cache).length === 1)
});


t.only('save', t => {
	let a = Audio(lena, (err, a) => {
		a.save('lena.wav', (err, a) => {
			if (!isBrowser) {
				let p = __dirname + path.sep + 'lena.wav'
				assert.ok(fs.existsSync(p))
				fs.unlinkSync(p);
			}
			t.end()
		})
	})
})


// t('create from buffer', t => {
// 	Audio(lena).volume(.5).play(() => {
// 		console.log('end');
github AmpersandJS / ampersand-router / test / index.js View on Github external
test.only = function (name, n, cb) {
        tape.only(moduleName + ': ' + name, function (t) {
            if (opts.setup) opts.setup();
            if (n) t.plan(n);
            cb(t);
            if (opts.teardown) opts.teardown();
            if (!n) t.end();
        });
    };
}
github shama / level-rest / test / index.js View on Github external
}, function() {
    if (only === true) tape.only(label, fn.bind(ctx))
    else tape(label, fn.bind(ctx))
  })
}
github witheve / Eve / test / distinct.ts View on Github external
distinct.only = function distinctOnly(name:string, roundCounts:number[][], expected:any) {
  test.only(`Distinct: ${name}`, (assert) => {
    distinctTest(assert, roundCounts, expected);
    assert.end();
  });
}
github mafintosh / hyperdrive / test / readdir.js View on Github external
try {
    await runAll([
      cb => writeFiles(drive, files, cb),
      cb => validateReaddir(t, drive, 'a', ['a', 'b', 'c', 'e'], cb),
      cb => validateReaddir(t, drive, 'a/c', ['d', 'e'], cb),
      cb => validateReaddir(t, drive, 'b', ['e', 'f', 'd'], cb),
      cb => validateReaddir(t, drive, '', ['a', 'b', 'e'], cb)
    ])
  } catch (err) {
    t.fail(err)
  }

  t.end()
})

test.only('readdir can include stats/mounts', async t => {
  const drive = create()

  const files = createFiles([
    'a/a',
    'a/b',
    'a/c/d',
    'a/c/e',
    'a/e',
    'b/e',
    'b/f',
    'b/d',
    'e'
  ])

  try {
    await runAll([
github gl-vis / regl-line2d / test / index.js View on Github external
.catch(t.fail)
  .then(() => {
    line2d.update([
      { thickness: 4, points: [0,0, 1,1, 1,0], close: true, color: 'red' },
      null,
      { thickness: 4, points: [0,1, 1,1, 0,0], close: true, color: 'blue' }
    ])
    line2d.draw(0)
    line2d.draw(2)

    return imageEqual('./test/35a.png', line2d)
  })
  .then(t.end, t.fail)
})

t.only('sin dash pattern', t => {
  let line = createLine(regl)

  var i, steps = 100
  var data = []
  for (i = 0; i < steps; i++) {
    data.push(i, Math.sin(i * 10 / steps))
  }

  line.update([{
    type: 'join',
    overlay: true,
    data: data,
    thickness: 4,
    dash: [8,8],
    range: [0,-2,steps * 2,2]
  }, {
github pusher / chatkit-server-node / tests / main.ts View on Github external
function testOnly(
  msg: string,
  cb: (
    t: any,
    client: Client,
    end: () => void,
    fail: (err: any) => void,
  ) => void,
): void {
  const client = new Client(clientConfig)

  tape.only(msg, t => {
    t.timeoutAfter(10 * 1000)
    cb(
      t,
      client,
      () =>
        deleteResources(client)
          .then(() => t.end())
          .catch(err => t.end(err)),
      err =>
        deleteResources(client)
          .then(() => t.end(err))
          .catch(() => t.end(err)),
    )
  })
}
github bjankord / stylelint-config-sass-guidelines / __tests__ / nesting-depth.js View on Github external
}
  }
}
`

const validScss = `
.button {
  @each $key, $value in $colors {
    &-#{$key} {
      background-color: $value;
    }
  }
}
`

test.only("Nesting depth scss", t => {
  t.plan(6)

  postcss()
    .use(stylelint({ code: invalidScss, config: config }))
    .process(invalidScss, { syntax: scssSyntax })
    .then(checkResult)
    .catch(logError)

  function checkResult(result) {
    t.equal(result.warnings().length, 3, "flags 3 warning")

    t.is(
      result.warnings()[0].text,
      "Expected nesting depth to be no more than 1 (max-nesting-depth)",
      "correct warning text"
    )
github mafintosh / tapenet / index.js View on Github external
test.only = (name, fn) => tape.only(name, t => runner(t, fn))
test.skip = (name, fn) => {}