mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
In self-test, make '--tests' into an argument and document it.
This commit is contained in:
@@ -1256,12 +1256,13 @@ main.registerCommand({
|
||||
|
||||
main.registerCommand({
|
||||
name: 'self-test',
|
||||
minArgs: 0,
|
||||
maxArgs: 1,
|
||||
options: {
|
||||
changed: { type: Boolean },
|
||||
'force-online': { type: Boolean },
|
||||
slow: { type: Boolean },
|
||||
history: { type: Number },
|
||||
tests: { type: String }
|
||||
},
|
||||
hidden: true
|
||||
}, function (options) {
|
||||
@@ -1279,13 +1280,13 @@ main.registerCommand({
|
||||
}
|
||||
|
||||
var testRegexp = undefined;
|
||||
if (options.tests) {
|
||||
if (options.args.length) {
|
||||
try {
|
||||
testRegexp = new RegExp(options.tests);
|
||||
testRegexp = new RegExp(options.args[0]);
|
||||
} catch (e) {
|
||||
if (!(e instanceof SyntaxError))
|
||||
throw e;
|
||||
process.stderr.write("Bad regular expression: " + options.tests + "\n");
|
||||
process.stderr.write("Bad regular expression: " + options.args[0] + "\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,10 +311,14 @@ system for building standalone command-line programs with Meteor.
|
||||
|
||||
>>> self-test
|
||||
Run tests of the 'meteor' tool.
|
||||
Usage: meteor self-test [--changed] [--slow] [--force-online] [--history n]
|
||||
Usage: meteor self-test [pattern] [--changed] [--slow]
|
||||
[--force-online] [--history n]
|
||||
|
||||
Runs internal tests. Exits with status 0 on success.
|
||||
|
||||
If 'pattern' is provided, it should be a regular expression. Only
|
||||
tests that match the regular expression will be run.
|
||||
|
||||
Pass --changed to run only tests that have changed since they last
|
||||
passed. This uses a really rough heuristic: A test has changed iff
|
||||
there has been any change to the file in the 'selftests' subdirectory
|
||||
|
||||
@@ -976,7 +976,7 @@ var tagDescriptions = {
|
||||
// these last two are not actually test tags; they reflect the use of
|
||||
// --changed and --tests
|
||||
unchanged: 'unchanged since last pass',
|
||||
misnamed: "don't match --tests argument"
|
||||
'non-matching': "don't match specified pattern"
|
||||
};
|
||||
|
||||
// options: onlyChanged, offline, includeSlowTests, historyLines, testRegexp
|
||||
@@ -1015,7 +1015,7 @@ var runTests = function (options) {
|
||||
tests = _.filter(tests, function (test) {
|
||||
return options.testRegexp.test(test.name);
|
||||
});
|
||||
skipCounts.misnamed = lengthBeforeTestRegexp - tests.length;
|
||||
skipCounts['non-matching'] = lengthBeforeTestRegexp - tests.length;
|
||||
}
|
||||
|
||||
if (options.onlyChanged) {
|
||||
|
||||
Reference in New Issue
Block a user