-
Notifications
You must be signed in to change notification settings - Fork 43
/
utils.js
41 lines (36 loc) · 1.24 KB
/
utils.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
33
34
35
36
37
38
39
40
41
/* global describe, it */
'use strict';
if (process.env.TEST_MOCKS_ON) {
require('./test_helper');
}
var utils = require('../lib/utils'),
assert = require('assert');
describe('File Association Test', () => {
it('Should create a file association for *.zzz files', () => {
utils.associateExeForFile('myTestHandler', 'A test handler for unit tests', '', 'C:\\Program Files\\nodejs\\node.exe %1', '.zzz');
assert(true);
});
});
describe('UAC elevate tests', () => {
it('Should get results for elevate for a given file', (done) => {
utils.elevate(process.execPath, 'index.js', function (err, result) {
assert.equal(err, null);
assert.equal(result, true);
done();
});
});
it('Empty file path, should return with error', (done) => {
utils.elevate('', null, function (err, result) {
assert.equal(err, 'Missing filepath');
assert.equal(result, null);
done();
});
});
it('Null file path, should return with error', (done) => {
utils.elevate(null, null, function (err, result) {
assert.equal(err, 'Missing filepath');
assert.equal(result, null);
done();
});
});
});