loopback-boot/test/helpers/sandbox.js

22 lines
592 B
JavaScript
Raw Normal View History

2016-05-06 04:52:36 +00:00
// Copyright IBM Corp. 2014. All Rights Reserved.
// Node module: loopback-boot
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
var fs = require('fs-extra');
var path = require('path');
var sandbox = exports;
sandbox.PATH = path.join(__dirname, '..', 'sandbox');
sandbox.reset = function() {
fs.removeSync(sandbox.PATH);
fs.mkdirsSync(sandbox.PATH);
};
sandbox.resolve = function() {
var args = Array.prototype.slice.apply(arguments);
args.unshift(sandbox.PATH);
return path.resolve.apply(path.resolve, args);
};