mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Reset settings between tests
This commit is contained in:
parent
c223e7f58f
commit
489c552dbe
@ -60,8 +60,8 @@ var persistentSettings = {
|
||||
if (globalSettings === null) {
|
||||
throw new Error("Settings not available");
|
||||
}
|
||||
var current = globalSettings[prop];
|
||||
globalSettings[prop] = value;
|
||||
var current = persistentSettings.get(prop);
|
||||
try {
|
||||
assert.deepEqual(current,value);
|
||||
return when.resolve();
|
||||
@ -72,6 +72,12 @@ var persistentSettings = {
|
||||
|
||||
available: function() {
|
||||
return (globalSettings !== null);
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
userSettings = null;
|
||||
globalSettings = null;
|
||||
storage = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,11 @@ var settings = require("../../red/settings");
|
||||
|
||||
|
||||
describe("red/settings", function() {
|
||||
|
||||
afterEach(function() {
|
||||
settings.reset();
|
||||
});
|
||||
|
||||
it('wraps the user settings as read-only properties', function() {
|
||||
var userSettings = {
|
||||
a: 123,
|
||||
|
Loading…
Reference in New Issue
Block a user