mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-28 04:19:01 +00:00
Fix problem with async each and creation of temporary directories
This commit is contained in:
parent
df698a24ba
commit
e0bee65cfc
@ -5,6 +5,7 @@ import path from 'path';
|
||||
import nativefier from './../../lib/index';
|
||||
import _ from 'lodash';
|
||||
import async from 'async';
|
||||
tmp.setGracefulCleanup();
|
||||
|
||||
let assert = chai.assert;
|
||||
|
||||
@ -43,11 +44,9 @@ function checkApp(appPath, inputOptions, callback) {
|
||||
describe('Nativefier Module', function() {
|
||||
this.timeout(30000);
|
||||
it('Can build an app from a target url', function(done) {
|
||||
async.eachSeries(PLATFORMS, (platform, callback) => {
|
||||
|
||||
var tmpObj = tmp.dirSync({unsafeCleanup: true});
|
||||
after(function() {
|
||||
tmpObj.removeCallback();
|
||||
});
|
||||
const tmpObj = tmp.dirSync({unsafeCleanup: true});
|
||||
|
||||
const tmpPath = tmpObj.name;
|
||||
const options = {
|
||||
@ -58,16 +57,14 @@ describe('Nativefier Module', function() {
|
||||
platform: null
|
||||
};
|
||||
|
||||
async.each(PLATFORMS, (platform, callback) => {
|
||||
let platformOptions = _.clone(options);
|
||||
platformOptions.platform = platform;
|
||||
nativefier(platformOptions, (error, appPath) => {
|
||||
options.platform = platform;
|
||||
nativefier(options, (error, appPath) => {
|
||||
if (error) {
|
||||
callback(error);
|
||||
return;
|
||||
}
|
||||
|
||||
checkApp(appPath, platformOptions, error => {
|
||||
checkApp(appPath, options, error => {
|
||||
callback(error);
|
||||
});
|
||||
});
|
||||
@ -76,3 +73,4 @@ describe('Nativefier Module', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user