   hinoki(source, lifetime, 'a').catch hinoki.PromiseRejectedError, (error) ->
     t.equal error.name, 'PromiseRejectedError'
     t.equal error.message, "promise returned from factory for `a` was rejected. original error `Error: fail`"
-    t.equal 'string', typeof error.stack
-    t.ok error.stack.split('\n').length > 8
+    if Error.captureStackTrace?
+      t.equal 'string', typeof error.stack
+      t.ok error.stack.split('\n').length > 8
 
     t.deepEqual error.path, ['a']
     t.equal error.error, rejection

  hinoki(source, lifetime, 'a').catch hinoki.FactoryReturnedUndefinedError, (error) ->
    t.equal error.name, 'FactoryReturnedUndefinedError'
    t.equal error.message, "factory for `a` returned undefined"
    t.equal 'string', typeof error.stack
    t.ok error.stack.split('\n').length > 8

    t.deepEqual error.path, ['a']
    t.equal error.factory, a

  hinoki(source, lifetime, 'a').catch hinoki.ErrorInFactory, (error) ->
    t.equal error.name, 'ErrorInFactory'
    t.equal error.message, "error in factory for `a`. original error `Error: fail`"
    if Error.captureStackTrace?
      t.equal 'string', typeof error.stack
      t.ok error.stack.split('\n').length > 8

    t.deepEqual error.path, ['a']
    t.equal error.factory, a
