UNPKG

585 BJavaScriptView Raw
1'use strict';
2
3var test = require('../../');
4
5if (typeof Promise === 'function' && typeof Promise.resolve === 'function') {
6 test('promise', function (t) {
7 t.test('sub test that should fail', function () {
8 return new Promise(function (resolve, reject) {
9 reject(new Error('rejection message'));
10 });
11 });
12 t.test('sub test that should pass', function (st) {
13 st.plan(1);
14 st.ok(true);
15 });
16 });
17} else {
18 // if promises aren't supported pass the node-tap test
19 console.log('skip');
20}