ここに同じ質問がありますが、私の問題に対する答えが見つからなかったので、ここに私の質問があります:
mochaとchaiを使用してノードjsアプリをテストしています。関数をラップするためにsinionを使用しています。
describe('App Functions', function(){
  let mockObj = sinon.stub(testApp, 'getObj', (dbUrl) => {
     //some stuff
  });
  it('get results',function(done) {
     testApp.someFun
  });
}
describe('App Errors', function(){
  let mockObj = sinon.stub(testApp, 'getObj', (dbUrl) => {
     //some stuff
  });
  it('throws errors',function(done) {
     testApp.someFun
  });
}
このテストを実行しようとすると、エラーが発生します
Attempted to wrap getObj which is already wrapped
私も入れてみました
beforeEach(function () {
  sandbox = sinon.sandbox.create();
});
afterEach(function () {
  sandbox.restore();
});
それぞれの説明で、しかしそれでも私に同じエラーを与えます。