only-twice.js 409 B

12345678910111213141516171819202122
  1. 'use strict';
  2. var tape = require('../');
  3. var tap = require('tap');
  4. tap.test('only twice error', function (assert) {
  5. var test = tape.createHarness({ exit: false });
  6. test.only('first only', function (t) {
  7. t.end();
  8. });
  9. assert['throws'](function () {
  10. test.only('second only', function (t) {
  11. t.end();
  12. });
  13. }, {
  14. name: 'Error',
  15. message: 'there can only be one only test'
  16. });
  17. assert.end();
  18. });