mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-31 19:27:00 -06:00
f97a13c382
* add logging and unit tests * fix logging msg spell for notification
29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
const getCmdLineArg = require('../../js/utils/getCmdLineArg.js');
|
|
|
|
describe('getCmdLineArg tests', function() {
|
|
it('should return no exact match', function() {
|
|
var result = getCmdLineArg([ 'hello.exe', '--arg1', '--arg2'], '--arg', true);
|
|
expect(result).toBe(null);
|
|
});
|
|
|
|
it('should return exact match only', function() {
|
|
var result = getCmdLineArg([ 'hello.exe', '--arg1', '--arg2'], '--arg2', true);
|
|
expect(result).toBe('--arg2');
|
|
});
|
|
|
|
it('should return starts with match', function() {
|
|
var result = getCmdLineArg([ 'hello.exe', '--hello=test', '--arg2'], '--hello=');
|
|
expect(result).toBe('--hello=test');
|
|
});
|
|
|
|
it('should return no match for starts with', function() {
|
|
var result = getCmdLineArg([ 'hello.exe', '--hello=test', '--arg2'], '--help=');
|
|
expect(result).toBe(null);
|
|
});
|
|
|
|
it('should return no match invalid argv given', function() {
|
|
var result = getCmdLineArg('invalid argv', '--help=');
|
|
expect(result).toBe(null);
|
|
});
|
|
});
|