Merge branch 'dev' into update-deps

This commit is contained in:
Nick O'Leary
2023-05-22 13:57:47 +01:00
committed by GitHub
19 changed files with 95 additions and 52 deletions

View File

@@ -854,7 +854,7 @@ describe('inject node', function() {
});
n1.on("call:error", function(err) {
count++;
if (count == 2) {
if (count == 1) {
done();
}
});

View File

@@ -61,12 +61,14 @@ describe("api/editor/index", function() {
sinon.stub(NR_TEST_UTILS.require("@node-red/editor-api/lib/editor/"+m),"init").callsFake(function(){});
});
sinon.stub(NR_TEST_UTILS.require("@node-red/editor-api/lib/editor/theme"),"app").callsFake(function(){ return express()});
sinon.stub(NR_TEST_UTILS.require("@node-red/editor-api/lib/editor/settings"),"sshkeys").callsFake(function(){ return express()});
});
after(function() {
mockList.forEach(function(m) {
NR_TEST_UTILS.require("@node-red/editor-api/lib/editor/"+m).init.restore();
})
NR_TEST_UTILS.require("@node-red/editor-api/lib/editor/theme").app.restore();
NR_TEST_UTILS.require("@node-red/editor-api/lib/editor/settings").sshkeys.restore();
auth.needsPermission.restore();
log.error.restore();
});

View File

@@ -41,7 +41,7 @@ describe("api/editor/settings", function() {
});
it('returns the user settings', function(done) {
info.init({
info.init({}, {
settings: {
getUserSettings: function(opts) {
if (opts.user !== "fred") {
@@ -67,7 +67,7 @@ describe("api/editor/settings", function() {
});
it('updates the user settings', function(done) {
var update;
info.init({
info.init({}, {
settings: {
updateUserSettings: function(opts) {
if (opts.user !== "fred") {

View File

@@ -34,7 +34,7 @@ describe("api/editor/sshkeys", function() {
}
}
before(function() {
sshkeys.init(mockRuntime);
sshkeys.init({}, mockRuntime);
app = express();
app.use(bodyParser.json());
app.use("/settings/user/keys", sshkeys.app());