From c9f916ebabc381329227050bad83110885ada0a1 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 9 Aug 2018 15:36:43 +0100 Subject: [PATCH] Fixup context test case to block until context close completes --- test/red/runtime/nodes/context/index_spec.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/red/runtime/nodes/context/index_spec.js b/test/red/runtime/nodes/context/index_spec.js index 487e5aca2..9a2907ef3 100644 --- a/test/red/runtime/nodes/context/index_spec.js +++ b/test/red/runtime/nodes/context/index_spec.js @@ -17,6 +17,7 @@ var should = require("should"); var sinon = require('sinon'); var path = require("path"); +var fs = require('fs-extra'); var Context = require("../../../../../red/runtime/nodes/context/index"); describe('context', function() { @@ -273,6 +274,8 @@ describe('context', function() { sandbox.reset(); return Context.clean({allNodes:{}}).then(function(){ return Context.close(); + }).then(function(){ + return fs.remove(resourcesDir); }); }); @@ -286,11 +289,11 @@ describe('context', function() { }); it('should load memory module', function() { Context.init({contextStorage:{memory:{module:"memory"}}}); - Context.load(); + return Context.load(); }); it('should load localfilesystem module', function() { Context.init({contextStorage:{file:{module:"localfilesystem",config:{dir:resourcesDir}}}}); - Context.load(); + return Context.load(); }); it('should ignore reserved storage name `_`', function(done) { Context.init({contextStorage:{_:{module:testPlugin}}});