From 879924dd5a86a0766d36ed377525af9f10e4d3fd Mon Sep 17 00:00:00 2001 From: masterZSH Date: Mon, 28 Oct 2019 17:58:20 +0800 Subject: [PATCH] Update test wrap if a space between function and * will test failed. --- test/wrap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/wrap.js b/test/wrap.js index f0641a6..a7c640a 100644 --- a/test/wrap.js +++ b/test/wrap.js @@ -22,7 +22,7 @@ describe('co.wrap(fn*)', function () { it('should expose the underlying generator function', function () { var wrapped = co.wrap(function* (a, b, c) {}); - var source = Object.toString.call(wrapped.__generatorFunction__); - assert(source.indexOf('function*') === 0); + var source = wrapped.__generatorFunction__.__proto__.constructor.name; + assert(source, 'GeneratorFunction'); }) })