forked from nwjs/nw.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmocha_test.js
32 lines (23 loc) · 817 Bytes
/
mocha_test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var path = require('path');
var app_test = require('./nw_test_app');
var fs = require('fs-extra');
describe('process', function() {
describe('exit', function(){
it('event process.exit should be fired after calling win.close(true)', function(done) {
var child = app_test.createChildProcess({
execPath: process.execPath,
appPath: path.join(global.tests_dir, 'process', 'exit'),
no_connect: true
});
setTimeout(function() {
fs.exists(path.join(global.tests_dir, 'process', 'exit', 'a.txt'), function (exists) {
if (exists) {
fs.unlink(path.join(global.tests_dir, 'process', 'exit', 'a.txt'), done);
} else {
done('the event `exit` does not been called.');
}
});
}, 1500);
})
})
})