//index.js
const functions = require('firebase-functions');
var Queue = require('firebase-queue');
var specQueue = new Queue();
//test.js
var assert = require('assert');
var sinon = require('sinon');
describe('test', function() {
var Queue, firebaseQueueStub;
before(() => {
Queue = require('firebase-queue');
firebaseQueueStub = sinon.createStubInstance(Queue);
myFunctions = require('../index');
});
describe('CREATED', function() {
it('should return -1 when the value is not present', function() {
assert.equal(-1, [1,5,3].indexOf(4));
});
});
});
如何在index.js中存根firebase队列构造函数?我已经尝试了上面的内容,但仍在调用firebase-queue而不是我的存根。感谢。