Skip to content

Commit

Permalink
Tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 15, 2014
1 parent 3198c72 commit 6298e7c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

var test = require('tape');
var genFunction = require('../');

test('genFunction is undefined or a generator', function (t) {
if (genFunction) {
t.equal(typeof genFunction, 'function', 'genFunction is function');
t.equal(String(genFunction), 'function* () { var x = yield; return x || 42; }', 'genFunction has expected body');
} else {
t.equal(typeof genFunction, 'undefined', 'genFunction is undefined');
}
t.end();
});

0 comments on commit 6298e7c

Please sign in to comment.