Exporting classes with node.js

后端 未结 4 915
清歌不尽
清歌不尽 2020-12-13 13:25

I have the following test code that is being ran by jasmine-node in a file called bob_test.spec.js

require(\'./bob\');

describe(\"Bob\", functi         


        
4条回答
  •  隐瞒了意图╮
    2020-12-13 13:56

    This should fix the error you were having while running your tests via jasmine-node:

    // Generated by CoffeeScript 1.6.2
    (function() {
      var Bob;
    
      Bob = (function() {
        function Bob() {}
    
        Bob.prototype.hey = function(what) {
          return 'Whatever.';
        };
    
        return Bob;
    
      })();
    
      module.exports = Bob;
    
    }).call(this);
    

提交回复
热议问题