mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
fix bug where savesettings did not honor local settings variables (#1073)
* fix bug where savesettings did not honor local settings variables * don't create lib/flows on read; It's already created in localfilesystem.init and in saveLibraryEntry - so removed call to promiseDir, and added a return of [] if accessing a folder which did not exist. This is important because else when settings.readOnly is true, it still creates folders. * Fix a CI failure where path passed to getLibraryEntry is empty; treat this case as meaning it was wanting a folder, and return empty if the folder dioes not exist * Add a test for getLibraryEntry( type, '/' ) as called by node-red * change newsettings to camelCase newSettings
This commit is contained in:
@@ -489,6 +489,19 @@ describe('LocalFileSystem', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should return an empty list of library objects (path=/)',function(done) {
|
||||
localfilesystem.init({userDir:userDir}).then(function() {
|
||||
localfilesystem.getLibraryEntry('object','/').then(function(flows) {
|
||||
flows.should.eql([]);
|
||||
done();
|
||||
}).otherwise(function(err) {
|
||||
done(err);
|
||||
});
|
||||
}).otherwise(function(err) {
|
||||
done(err);
|
||||
});
|
||||
});
|
||||
|
||||
it('should return an error for a non-existent library object',function(done) {
|
||||
localfilesystem.init({userDir:userDir}).then(function() {
|
||||
localfilesystem.getLibraryEntry('object','A/B').then(function(flows) {
|
||||
|
Reference in New Issue
Block a user