|
6 | 6 | (function (process, require, program, exit, packageJson, Q, Joi, fs, path, Mocha) { |
7 | 7 | 'use strict'; |
8 | 8 |
|
| 9 | + var DIRECTORY = 'v1_0_2'; |
| 10 | + |
9 | 11 | program |
10 | 12 | .version(packageJson.version) |
11 | 13 | .usage('[options]') |
12 | | - .option('-d, --directory [path]', 'test directory, default: test/v1_0_2') |
| 14 | + .option('-d, --directory [path]', 'test directory, default: ' + DIRECTORY) |
13 | 15 | .option('-e, --endpoint <path>', 'the connection string') |
14 | 16 | .option('-a, --basicAuth <true/false>', 'enables basic authentication') |
15 | 17 | .option('-u, --authUser <username>', 'sets user name (required when basic authentication enabled)') |
|
33 | 35 |
|
34 | 36 | process.nextTick(function () { |
35 | 37 | var options = { |
36 | | - directory: program.directory || 'test/v1_0_2', |
| 38 | + directory: program.directory || DIRECTORY, |
37 | 39 | endpoint: program.endpoint, |
38 | 40 | basicAuth: program.basicAuth, |
39 | 41 | authUser: program.authUser, |
|
48 | 50 | process.env.BASIC_AUTH_ENABLED = options.basicAuth; |
49 | 51 | process.env.BASIC_AUTH_USER = options.authUser; |
50 | 52 | process.env.BASIC_AUTH_PASSWORD = options.authPass; |
51 | | - var testDirectory = options.directory; |
| 53 | + var testDirectory = 'test/' + options.directory; |
52 | 54 | fs.readdirSync(testDirectory).filter(function (file) { |
53 | 55 | return file.substr(-3) === '.js'; |
54 | 56 | }).forEach(function (file) { |
|
0 commit comments