Skip to content

Commit 415cd2f

Browse files
committed
Use consistent comment capitalization
1 parent 2c6082f commit 415cd2f

31 files changed

+113
-113
lines changed

api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ Api.prototype._runWithoutPool = function (files, runStatus) {
287287
return err.results;
288288
})
289289
.tap(function (results) {
290-
// if no tests ran, make sure to tear down the child processes
290+
// If no tests ran, make sure to tear down the child processes
291291
if (results.length === 0) {
292292
tests.forEach(function (test) {
293293
test.send('teardown');
294294
});
295295
}
296296
})
297297
.then(function (results) {
298-
// cancel debounced _onTimeout() from firing
298+
// Cancel debounced _onTimeout() from firing
299299
if (self.options.timeout) {
300300
self._cancelTimeout(runStatus);
301301
}
@@ -346,7 +346,7 @@ Api.prototype._runWithPool = function (files, runStatus, concurrency) {
346346
// Filter out undefined results (usually result of caught exceptions)
347347
results = results.filter(Boolean);
348348

349-
// cancel debounced _onTimeout() from firing
349+
// Cancel debounced _onTimeout() from firing
350350
if (self.options.timeout) {
351351
self._cancelTimeout(runStatus);
352352
}

bench/compare.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let files = fs.readdirSync(path.join(__dirname, '.results'))
1010
result['.file'] = path.basename(file, '.json');
1111
return result;
1212
})
13-
// find the most recent benchmark runs
13+
// Find the most recent benchmark runs
1414
.sort((fileA, fileB) => fileB['.time'] - fileA['.time']);
1515

1616
function average(data) {
@@ -31,15 +31,15 @@ function standardDeviation(values) {
3131
return stdDev;
3232
}
3333

34-
// only the 3 most recent runs
34+
// Only the 3 most recent runs
3535
files = files.slice(0, 3);
3636

3737
function prepStats(times) {
3838
times = times
3939
.map(time => time.time)
4040
.sort((timeA, timeB) => timeA - timeB);
4141

42-
// remove fastest and slowest
42+
// Remove fastest and slowest
4343
times = times.slice(1, times.length - 1);
4444

4545
const sum = times.reduce((a, b) => a + b, 0);

lib/assert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ x.ifError = (err, msg) => {
152152
};
153153

154154
x._snapshot = function (tree, optionalMessage, match, snapshotStateGetter) {
155-
// set defaults - this allows tests to mock deps easily
155+
// Set defaults - this allows tests to mock deps easily
156156
const toMatchSnapshot = match || jestSnapshot.toMatchSnapshot;
157157
const getState = snapshotStateGetter || snapshotState.get;
158158

@@ -186,7 +186,7 @@ x.snapshot = function (tree, optionalMessage) {
186186
};
187187

188188
/*
189-
* deprecated APIs
189+
* Deprecated APIs
190190
*/
191191
x.ok = util.deprecate(x.truthy, getDeprecationNotice('ok()', 'truthy()'));
192192
x.notOk = util.deprecate(x.falsy, getDeprecationNotice('notOk()', 'falsy()'));

lib/babel-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function validate(conf) {
1111
conf = 'default';
1212
}
1313

14-
// check for valid babel config shortcuts (can be either `default` or `inherit`)
14+
// Check for valid babel config shortcuts (can be either `default` or `inherit`)
1515
const isValidShortcut = conf === 'default' || conf === 'inherit';
1616

1717
if (!conf || (typeof conf === 'string' && !isValidShortcut)) {
@@ -72,7 +72,7 @@ const espowerPlugin = lazy(() => {
7272
const babel = require('babel-core');
7373
const createEspowerPlugin = require('babel-plugin-espower/create');
7474

75-
// initialize power-assert
75+
// Initialize power-assert
7676
return createEspowerPlugin(babel, {
7777
embedAst: true,
7878
patterns: require('./enhance-assert').PATTERNS

lib/beautify-stack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const StackUtils = require('stack-utils');
33
const cleanStack = require('clean-stack');
44
const debug = require('debug')('ava');
55

6-
// ignore unimportant stack trace lines
6+
// Ignore unimportant stack trace lines
77
let ignoreStackLines = [];
88

99
const avaInternals = /\/ava\/(?:lib\/)?[\w-]+\.js:\d+:\d+\)?$/;
@@ -22,7 +22,7 @@ module.exports = function (stack) {
2222
return '';
2323
}
2424

25-
// workaround for https://github.com/tapjs/stack-utils/issues/14
25+
// Workaround for https://github.com/tapjs/stack-utils/issues/14
2626
// TODO: fix it in `stack-utils`
2727
stack = cleanStack(stack);
2828

lib/caching-precompiler.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ CachingPrecompiler.prototype.precompileFile = function (filePath) {
3737
return this.fileHashes[filePath];
3838
};
3939

40-
// conditionally called by caching-transform when precompiling is required
40+
// Conditionally called by caching-transform when precompiling is required
4141
CachingPrecompiler.prototype._init = function () {
4242
this.babel = require('babel-core');
4343

@@ -50,12 +50,12 @@ CachingPrecompiler.prototype._transform = function (code, filePath, hash) {
5050
var options = babelConfigHelper.build(this.babelConfig, this.powerAssert, filePath, code);
5151
var result = this.babel.transform(code, options);
5252

53-
// save source map
53+
// Save source map
5454
var mapPath = path.join(this.cacheDirPath, hash + '.js.map');
5555
fs.writeFileSync(mapPath, JSON.stringify(result.map));
5656

57-
// append source map comment to transformed code
58-
// so that other libraries (like nyc) can find the source map
57+
// Append source map comment to transformed code
58+
// So that other libraries (like nyc) can find the source map
5959
var dirPath = path.dirname(filePath);
6060
var relativeMapPath = path.relative(dirPath, mapPath);
6161
var comment = convertSourceMap.generateMapFileComment(relativeMapPath);

lib/concurrent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ class Concurrent {
5151
return this._addResult(result, index);
5252
}
5353
_addResult(result, index) {
54-
// always save result when not in bail mode or all previous tests pass
54+
// Always save result when not in bail mode or all previous tests pass
5555
if ((this.bail && this.passed) || !this.bail) {
5656
this.results[index] = result;
5757
}
5858

5959
if (result.passed === false) {
6060
this.passed = false;
6161

62-
// only set reason once
62+
// Only set reason once
6363
if (!this.reason) {
6464
this.reason = result.reason;
6565
}

lib/enhance-assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports.PATTERNS = [
1414
't.notDeepEqual(value, expected, [message])',
1515
't.regex(contents, regex, [message])',
1616
't.notRegex(contents, regex, [message])',
17-
// deprecated apis
17+
// Deprecated apis
1818
't.ok(value, [message])',
1919
't.notOk(value, [message])',
2020
't.same(value, expected, [message])',

lib/fork.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if (fs.realpathSync(__filename) !== __filename) {
1212

1313
let env = process.env;
1414

15-
// ensure NODE_PATH paths are absolute
15+
// Ensure NODE_PATH paths are absolute
1616
if (env.NODE_PATH) {
1717
env = Object.assign({}, env);
1818

@@ -65,7 +65,7 @@ module.exports = (file, opts, execArgv) => {
6565
const promise = new Promise((resolve, reject) => {
6666
ps.on('error', reject);
6767

68-
// emit `test` and `stats` events
68+
// Emit `test` and `stats` events
6969
ps.on('message', event => {
7070
if (!event.ava) {
7171
return;
@@ -118,13 +118,13 @@ module.exports = (file, opts, execArgv) => {
118118
});
119119
});
120120

121-
// teardown finished, now exit
121+
// Teardown finished, now exit
122122
ps.on('teardown', () => {
123123
send('exit');
124124
exiting = true;
125125
});
126126

127-
// uncaught exception in fork, need to exit
127+
// Uncaught exception in fork, need to exit
128128
ps.on('uncaughtException', () => {
129129
send('teardown');
130130
});
@@ -152,7 +152,7 @@ module.exports = (file, opts, execArgv) => {
152152
return promise;
153153
};
154154

155-
// send 'run' event only when fork is listening for it
155+
// Send 'run' event only when fork is listening for it
156156
let isReady = false;
157157

158158
ps.on('stats', () => {

lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ const runner = new Runner({
1212
match: opts.match
1313
});
1414

15-
// note that test files have require('ava')
15+
// Note that test files have require('ava')
1616
require('./test-worker').avaRequired = true;
1717

18-
// if fail-fast is enabled, use this variable to detect
18+
// If fail-fast is enabled, use this variable to detect
1919
// that no more tests should be logged
2020
let isFailed = false;
2121

@@ -28,7 +28,7 @@ function test(props) {
2828

2929
const hasError = typeof props.error !== 'undefined';
3030

31-
// don't display anything if it's a passed hook
31+
// Don't display anything if it's a passed hook
3232
if (!hasError && props.type !== 'test') {
3333
return;
3434
}

0 commit comments

Comments
 (0)