Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Doesn't work with es2015-classes #122

Open
z-vr opened this issue Oct 15, 2017 · 1 comment
Open

Doesn't work with es2015-classes #122

z-vr opened this issue Oct 15, 2017 · 1 comment

Comments

@z-vr
Copy link

z-vr commented Oct 15, 2017

class Test {
    async test() {
        throw new Error('test-error');
    }
}
      AssertionError [ERR_ASSERTION]: '\'use strict\';\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length == 'class Test {\n    test() {\n        return Promise.resolve().then(function () {\n            throw new Error(\'test-error\');\n
      + expected - actual

      -'use strict';
      -
      -var _createClass = function () { function defineProperties(target, props) { for (var i = 0;i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
      -
      -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function"); } }
      -
      -var Test = function () {
      -    function Test() {
      -        _classCallCheck(this, Test);
      +class Test {
      +    test() {
      +        return Promise.resolve().then(function () {
      +            throw new Error('test-error');
      +        });
           }
      -
      -    _createClass(Test, [{
      -        key: 'test',
      -        value: function test() {
      -            throw new Error('test-error');
      -        }
      -    }]);
      -
      -    return Test;
      -}();
      +}

      at Context.<anonymous> (test/index.js:30:14)
@loganfsmyth
Copy link
Member

Thanks for filing. Beware that this module is essentially unmaintained currently. Happy to leave this open, but it probably won't get fixed.

You may want to take a look at https://www.npmjs.com/package/fast-async

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants