From 96d81ef72bbd1b77c16bbd9d82efd2d78e99f753 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 24 Sep 2020 16:54:24 +0100 Subject: [PATCH] Add slight delay to fix config.json file tests --- .../lib/storage/localfilesystem/settings_spec.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/unit/@node-red/runtime/lib/storage/localfilesystem/settings_spec.js b/test/unit/@node-red/runtime/lib/storage/localfilesystem/settings_spec.js index 8b859ec35..87a0a95b6 100644 --- a/test/unit/@node-red/runtime/lib/storage/localfilesystem/settings_spec.js +++ b/test/unit/@node-red/runtime/lib/storage/localfilesystem/settings_spec.js @@ -100,8 +100,13 @@ describe('storage/localfilesystem/settings', function() { const fsStatProjects = await fs.stat(path.join(userDir,".config.projects.json")) const fsStatRuntime = await fs.stat(path.join(userDir,".config.runtime.json")) - return localfilesystemSettings.init({userDir:userDir}).then(() => { - + return localfilesystemSettings.init({userDir:userDir}).then(function() { + return new Promise(res => { + setTimeout(function() { + res(); + },10) + }); + }).then(() => { return localfilesystemSettings.saveSettings({ nodes:{d:4}, _credentialSecret: "bar", @@ -109,6 +114,7 @@ describe('storage/localfilesystem/settings', function() { projects: {c:3} }) }).then(async function() { + const newFsStatNodes = await fs.stat(path.join(userDir,".config.nodes.json")) const newFsStatUsers = await fs.stat(path.join(userDir,".config.users.json")) const newFsStatProjects = await fs.stat(path.join(userDir,".config.projects.json"))