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:
@@ -45,35 +45,35 @@ describe("api/admin/index", function() {
|
||||
};
|
||||
before(function() {
|
||||
mockList.forEach(function(m) {
|
||||
sinon.stub(m,"init",function(){});
|
||||
sinon.stub(m,"init").callsFake(function(){});
|
||||
});
|
||||
sinon.stub(auth,"needsPermission", function(permission) {
|
||||
sinon.stub(auth,"needsPermission").callsFake(function(permission) {
|
||||
return function(req,res,next) {
|
||||
permissionChecks[permission] = (permissionChecks[permission]||0)+1;
|
||||
next();
|
||||
};
|
||||
});
|
||||
|
||||
sinon.stub(flows,"get",stubApp);
|
||||
sinon.stub(flows,"post",stubApp);
|
||||
sinon.stub(flows,"get").callsFake(stubApp);
|
||||
sinon.stub(flows,"post").callsFake(stubApp);
|
||||
|
||||
sinon.stub(flow,"get",stubApp);
|
||||
sinon.stub(flow,"post",stubApp);
|
||||
sinon.stub(flow,"delete",stubApp);
|
||||
sinon.stub(flow,"put",stubApp);
|
||||
sinon.stub(flow,"get").callsFake(stubApp);
|
||||
sinon.stub(flow,"post").callsFake(stubApp);
|
||||
sinon.stub(flow,"delete").callsFake(stubApp);
|
||||
sinon.stub(flow,"put").callsFake(stubApp);
|
||||
|
||||
sinon.stub(nodes,"getAll",stubApp);
|
||||
sinon.stub(nodes,"post",stubApp);
|
||||
sinon.stub(nodes,"getModule",stubApp);
|
||||
sinon.stub(nodes,"putModule",stubApp);
|
||||
sinon.stub(nodes,"delete",stubApp);
|
||||
sinon.stub(nodes,"getSet",stubApp);
|
||||
sinon.stub(nodes,"putSet",stubApp);
|
||||
sinon.stub(nodes,"getModuleCatalog",stubApp);
|
||||
sinon.stub(nodes,"getModuleCatalogs",stubApp);
|
||||
sinon.stub(nodes,"getAll").callsFake(stubApp);
|
||||
sinon.stub(nodes,"post").callsFake(stubApp);
|
||||
sinon.stub(nodes,"getModule").callsFake(stubApp);
|
||||
sinon.stub(nodes,"putModule").callsFake(stubApp);
|
||||
sinon.stub(nodes,"delete").callsFake(stubApp);
|
||||
sinon.stub(nodes,"getSet").callsFake(stubApp);
|
||||
sinon.stub(nodes,"putSet").callsFake(stubApp);
|
||||
sinon.stub(nodes,"getModuleCatalog").callsFake(stubApp);
|
||||
sinon.stub(nodes,"getModuleCatalogs").callsFake(stubApp);
|
||||
|
||||
sinon.stub(context,"get",stubApp);
|
||||
sinon.stub(context,"delete",stubApp);
|
||||
sinon.stub(context,"get").callsFake(stubApp);
|
||||
sinon.stub(context,"delete").callsFake(stubApp);
|
||||
});
|
||||
after(function() {
|
||||
mockList.forEach(function(m) {
|
||||
|
@@ -41,7 +41,7 @@ describe("api/admin/nodes", function() {
|
||||
app.put(/\/nodes\/((@[^\/]+\/)?[^\/]+)\/([^\/]+)$/,nodes.putSet);
|
||||
app.get("/getIcons",nodes.getIcons);
|
||||
app.delete(/\/nodes\/((@[^\/]+\/)?[^\/]+)$/,nodes.delete);
|
||||
sinon.stub(apiUtil,"determineLangFromHeaders", function() {
|
||||
sinon.stub(apiUtil,"determineLangFromHeaders").callsFake(function() {
|
||||
return "en-US";
|
||||
});
|
||||
});
|
||||
|
@@ -29,7 +29,7 @@ var theme = NR_TEST_UTILS.require("@node-red/editor-api/lib/editor/theme");
|
||||
|
||||
describe("api/editor/settings", function() {
|
||||
before(function() {
|
||||
sinon.stub(theme,"settings",function() { return { existing: 123, test: 456 };});
|
||||
sinon.stub(theme,"settings").callsFake(function() { return { existing: 123, test: 456 };});
|
||||
app = express();
|
||||
app.use(bodyParser.json());
|
||||
app.get("/settings",info.runtimeSettings);
|
||||
|
Reference in New Issue
Block a user