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 nativefier from './../../lib/index';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import async from 'async';
|
import async from 'async';
|
||||||
|
tmp.setGracefulCleanup();
|
||||||
|
|
||||||
let assert = chai.assert;
|
let assert = chai.assert;
|
||||||
|
|
||||||
@ -43,11 +44,9 @@ function checkApp(appPath, inputOptions, callback) {
|
|||||||
describe('Nativefier Module', function() {
|
describe('Nativefier Module', function() {
|
||||||
this.timeout(30000);
|
this.timeout(30000);
|
||||||
it('Can build an app from a target url', function(done) {
|
it('Can build an app from a target url', function(done) {
|
||||||
|
async.eachSeries(PLATFORMS, (platform, callback) => {
|
||||||
|
|
||||||
var tmpObj = tmp.dirSync({unsafeCleanup: true});
|
const tmpObj = tmp.dirSync({unsafeCleanup: true});
|
||||||
after(function() {
|
|
||||||
tmpObj.removeCallback();
|
|
||||||
});
|
|
||||||
|
|
||||||
const tmpPath = tmpObj.name;
|
const tmpPath = tmpObj.name;
|
||||||
const options = {
|
const options = {
|
||||||
@ -58,16 +57,14 @@ describe('Nativefier Module', function() {
|
|||||||
platform: null
|
platform: null
|
||||||
};
|
};
|
||||||
|
|
||||||
async.each(PLATFORMS, (platform, callback) => {
|
options.platform = platform;
|
||||||
let platformOptions = _.clone(options);
|
nativefier(options, (error, appPath) => {
|
||||||
platformOptions.platform = platform;
|
|
||||||
nativefier(platformOptions, (error, appPath) => {
|
|
||||||
if (error) {
|
if (error) {
|
||||||
callback(error);
|
callback(error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkApp(appPath, platformOptions, error => {
|
checkApp(appPath, options, error => {
|
||||||
callback(error);
|
callback(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -76,3 +73,4 @@ describe('Nativefier Module', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user