mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Update to latest sinon
This commit is contained in:
@@ -31,18 +31,18 @@ var apiAdmin = NR_TEST_UTILS.require("@node-red/editor-api/lib/admin");
|
||||
|
||||
describe("api/index", function() {
|
||||
var beforeEach = function() {
|
||||
sinon.stub(apiAuth,"init",function(){});
|
||||
sinon.stub(apiEditor,"init",function(){
|
||||
sinon.stub(apiAuth,"init").callsFake(function(){});
|
||||
sinon.stub(apiEditor,"init").callsFake(function(){
|
||||
var app = express();
|
||||
app.get("/editor",function(req,res) { res.status(200).end(); });
|
||||
return app;
|
||||
});
|
||||
sinon.stub(apiAdmin,"init",function(){
|
||||
sinon.stub(apiAdmin,"init").callsFake(function(){
|
||||
var app = express();
|
||||
app.get("/admin",function(req,res) { res.status(200).end(); });
|
||||
return app;
|
||||
});
|
||||
sinon.stub(apiAuth,"login",function(req,res){
|
||||
sinon.stub(apiAuth,"login").callsFake(function(req,res){
|
||||
res.status(200).end();
|
||||
});
|
||||
};
|
||||
@@ -115,7 +115,7 @@ describe("api/index", function() {
|
||||
describe('initialises api with authentication enabled', function(done) {
|
||||
|
||||
it('enables an oauth/openID based authentication mechanism',function(done) {
|
||||
const stub = sinon.stub(apiAuth, 'genericStrategy', function(){});
|
||||
const stub = sinon.stub(apiAuth, 'genericStrategy').callsFake(function(){});
|
||||
const adminAuth = { type: 'strategy', strategy: {} }
|
||||
api.init({ httpAdminRoot: true, adminAuth },{},{},{});
|
||||
should(stub.called).be.ok();
|
||||
@@ -159,7 +159,7 @@ describe("api/index", function() {
|
||||
describe('editor start', function (done) {
|
||||
|
||||
it('cannot be started when editor is disabled', function (done) {
|
||||
const stub = sinon.stub(apiEditor, 'start', function () {
|
||||
const stub = sinon.stub(apiEditor, 'start').callsFake(function () {
|
||||
return Promise.resolve(true);
|
||||
});
|
||||
api.init({ httpAdminRoot: true, disableEditor: true }, {}, {}, {});
|
||||
|
Reference in New Issue
Block a user