Skip to content

Commit

Permalink
style(test): Fix several typos 💎
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Aug 21, 2017
1 parent 60f3e48 commit e5a8c31
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ test('Parse with "conventional-changelog-angular" by default', async t => {
t.is(releaseType, 'minor');
});

test('Accept preset option', async t => {
test('Accept "preset" option', async t => {
const commits = [{message: 'Fix: First fix (fixes #123)'}, {message: 'Update: Second feature (fixes #456)'}];
const releaseType = await pify(commitAnalyzer)({preset: 'eslint'}, {commits});

t.is(releaseType, 'minor');
});

test('Accept config option', async t => {
test('Accept "config" option', async t => {
const commits = [{message: 'Fix: First fix (fixes #123)'}, {message: 'Update: Second feature (fixes #456)'}];
const releaseType = await pify(commitAnalyzer)({config: 'conventional-changelog-eslint'}, {commits});

t.is(releaseType, 'minor');
});

test('Accept a parseOpts object as option', async t => {
test('Accept a "parseOpts" object as option', async t => {
const commits = [
{message: '##BUGFIX## First fix (fixes #123)'},
{message: '##FEATURE## Second feature (fixes #456)'},
Expand All @@ -37,7 +37,7 @@ test('Accept a parseOpts object as option', async t => {
t.is(releaseType, 'minor');
});

test('Accept a partial parseOpts object as option', async t => {
test('Accept a partial "parseOpts" object as option', async t => {
const commits = [{message: '##fix## First fix (fixes #123)'}, {message: '##Update## Second feature (fixes #456)'}];
const releaseType = await pify(commitAnalyzer)(
{
Expand Down Expand Up @@ -87,7 +87,7 @@ test('Allow to use regex in commitTypes configuration', async t => {
t.is(releaseType, 'minor');
});

test('Return null if no rule match', async t => {
test('Return "null" if no rule match', async t => {
const commits = [{message: 'doc: doc update'}, {message: 'chore: Chore'}];
const releaseType = await pify(commitAnalyzer)({}, {commits});

Expand Down Expand Up @@ -117,7 +117,7 @@ test('Process rules in order and apply highest match from config even if default
t.is(releaseType, 'minor');
});

test('Use default commitTypes if none of provided match', async t => {
test('Use default "commitTypes" if none of provided match', async t => {
const commits = [{message: 'Chore: First chore'}, {message: 'Update: new feature'}];
const releaseType = await pify(commitAnalyzer)(
{preset: 'eslint', commitTypes: [{tag: 'Chore', release: 'patch'}]},
Expand All @@ -127,7 +127,7 @@ test('Use default commitTypes if none of provided match', async t => {
t.is(releaseType, 'minor');
});

test('Throw SemanticReleaseError if "preset" doesn`t exist', async t => {
test('Throw "SemanticReleaseError" if "preset" doesn`t exist', async t => {
const error = await t.throws(
pify(commitAnalyzer)({preset: 'unknown-preset'}, {}),
/Preset: "unknown-preset" does not exist:/
Expand All @@ -137,7 +137,7 @@ test('Throw SemanticReleaseError if "preset" doesn`t exist', async t => {
t.is(error.code, 'MODULE_NOT_FOUND');
});

test('Throw SemanticReleaseError if "commitTypes" is not an Array or a String', async t => {
test('Throw "SemanticReleaseError" if "commitTypes" is not an Array or a String', async t => {
const error = await t.throws(
pify(commitAnalyzer)({commitTypes: {}}, {}),
/Error in sr-commit-analyzer configuration: "commitTypes" must be an array of rules/
Expand All @@ -147,7 +147,7 @@ test('Throw SemanticReleaseError if "commitTypes" is not an Array or a String',
t.is(error.code, 'EINVALIDCONFIG');
});

test('Throw SemanticReleaseError if "commitTypes" commitTypes option reference a requierable module that is not an Array or a String', async t => {
test('Throw "SemanticReleaseError" if "commitTypes" option reference a requierable module that is not an Array or a String', async t => {
const error = await t.throws(
pify(commitAnalyzer)({commitTypes: './test/fixtures/commit-types-invalid'}, {}),
/Error in sr-commit-analyzer configuration: "commitTypes" must be an array of rules/
Expand All @@ -157,7 +157,7 @@ test('Throw SemanticReleaseError if "commitTypes" commitTypes option reference a
t.is(error.code, 'EINVALIDCONFIG');
});

test('Throw SemanticReleaseError if "config" doesn`t exist', async t => {
test('Throw "SemanticReleaseError" if "config" doesn`t exist', async t => {
const commits = [{message: 'Fix: First fix (fixes #123)'}, {message: 'Update: Second feature (fixes #456)'}];
const error = await t.throws(
pify(commitAnalyzer)({config: 'unknown-config'}, {commits}),
Expand All @@ -168,7 +168,7 @@ test('Throw SemanticReleaseError if "config" doesn`t exist', async t => {
t.is(error.code, 'MODULE_NOT_FOUND');
});

test('Throw SemanticReleaseError if "commitTypes" reference invalid commit type', async t => {
test('Throw "SemanticReleaseError" if "commitTypes" reference invalid commit type', async t => {
const error = await t.throws(
pify(commitAnalyzer)({preset: 'eslint', commitTypes: [{tag: 'Update', release: 'invalid'}]}, {}),
/Error in sr-commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/
Expand All @@ -178,7 +178,7 @@ test('Throw SemanticReleaseError if "commitTypes" reference invalid commit type'
t.true(error instanceof SemanticReleaseError);
});

test('Handle error in "conventional-changelog-parser" and wrap in SemanticReleaseError', async t => {
test('Handle error in "conventional-changelog-parser" and wrap in "SemanticReleaseError"', async t => {
const commits = [{message: 'Fix: First fix (fixes #123)'}, {message: 'Update: Second feature (fixes #456)'}];
const error = await t.throws(
pify(commitAnalyzer)({parserOpts: {headerPattern: '\\'}}, {commits}),
Expand Down
6 changes: 3 additions & 3 deletions test/load-commit-types.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('Return undefined if "commitTypes" not set', t => {
t.is(releaseTypes, undefined);
});

test('Throw SemanticReleaseError if "commitTypes" reference invalid commit type', t => {
test('Throw "SemanticReleaseError" if "commitTypes" reference invalid commit type', t => {
const error = t.throws(
() => loadCommitTypes({commitTypes: [{tag: 'Update', release: 'invalid'}]}),
/Error in sr-commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/
Expand All @@ -31,7 +31,7 @@ test('Throw SemanticReleaseError if "commitTypes" reference invalid commit type'
t.true(error instanceof SemanticReleaseError);
});

test('Throw SemanticReleaseError if "commitTypes" is not an Array or a String', t => {
test('Throw "SemanticReleaseError" if "commitTypes" is not an Array or a String', t => {
const error = t.throws(
() => loadCommitTypes({commitTypes: {}}, {}),
/Error in sr-commit-analyzer configuration: "commitTypes" must be an array of rules/
Expand All @@ -41,7 +41,7 @@ test('Throw SemanticReleaseError if "commitTypes" is not an Array or a String',
t.is(error.code, 'EINVALIDCONFIG');
});

test('Throw SemanticReleaseError if "commitTypes" option reference a requierable module that is not an Array or a String', t => {
test('Throw "SemanticReleaseError" if "commitTypes" option reference a requierable module that is not an Array or a String', t => {
const error = t.throws(
() => loadCommitTypes({commitTypes: './test/fixtures/commit-types-invalid'}),
/Error in sr-commit-analyzer configuration: "commitTypes" must be an array of rules/
Expand Down
16 changes: 8 additions & 8 deletions test/load-parser-config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import loadParserConfig from './../lib/load/parser-config';
* AVA macro to verify that `loadParserConfig` return a parserOpts object.
*
* @method loadPreset
* @param {Object} t AVA assertion librarie.
* @param {Object} t AVA assertion library.
* @param {[type]} preset the `conventional-changelog` preset to test.
*/
async function loadPreset(t, preset) {
Expand All @@ -18,7 +18,7 @@ loadPreset.title = (providedTitle, preset) => `${providedTitle} Load "${preset}"
* AVA macro to verify that `loadParserConfig` return a parserOpts object.
*
* @method loadPreset
* @param {Object} t AVA assertion librarie.
* @param {Object} t AVA assertion library.
* @param {[type]} config the `conventional-changelog` config to test.
*/
async function loadConfig(t, config) {
Expand All @@ -30,7 +30,7 @@ test('Load "conventional-changelog-angular" by default', async t => {
t.deepEqual(await loadParserConfig({}), (await require('conventional-changelog-angular')).parserOpts);
});

test('Accept a parserOpts object as option', async t => {
test('Accept a "parserOpts" object as option', async t => {
const customParserOpts = {headerPattern: /^##(.*?)## (.*)$/, headerCorrespondence: ['tag', 'shortDesc']};
const parserOpts = await loadParserConfig({parserOpts: customParserOpts});

Expand All @@ -39,7 +39,7 @@ test('Accept a parserOpts object as option', async t => {
t.falsy(parserOpts.noteKeywords);
});

test('Accept a partial parserOpts object as option that overlaod a preset', async t => {
test('Accept a partial "parserOpts" object as option that overlaod a preset', async t => {
const customParserOpts = {headerPattern: /^##(.*?)## (.*)$/, headerCorrespondence: ['tag', 'shortDesc']};
const parserOpts = await loadParserConfig({parserOpts: customParserOpts, preset: 'angular'});

Expand All @@ -48,7 +48,7 @@ test('Accept a partial parserOpts object as option that overlaod a preset', asyn
t.truthy(parserOpts.noteKeywords);
});

test('Accept a partial parserOpts object as option that overlaod a config', async t => {
test('Accept a partial "parserOpts" object as option that overlaod a config', async t => {
const customParserOpts = {headerPattern: /^##(.*?)## (.*)$/, headerCorrespondence: ['tag', 'shortDesc']};
const parserOpts = await loadParserConfig({parserOpts: customParserOpts, config: 'conventional-changelog-angular'});

Expand All @@ -70,7 +70,7 @@ test(loadConfig, 'express');
test(loadPreset, 'jshint');
test(loadConfig, 'jshint');

test('Throw SemanticReleaseError if "config" doesn`t exist', async t => {
test('Throw "SemanticReleaseError" if "config" doesn`t exist', async t => {
const error = await t.throws(
loadParserConfig({config: 'unknown-config'}),
/Config: "unknown-config" does not exist:/
Expand All @@ -80,9 +80,9 @@ test('Throw SemanticReleaseError if "config" doesn`t exist', async t => {
t.is(error.code, 'MODULE_NOT_FOUND');
});

test('Throw SemanticReleaseError if "preset" doesn`t exist', async t => {
test('Throw "SemanticReleaseError" if "preset" doesn`t exist', async t => {
const error = await t.throws(
loadParserConfig({preset: 'unknown-preset'}, {}),
loadParserConfig({preset: 'unknown-preset'}),
/Preset: "unknown-preset" does not exist:/
);

Expand Down
2 changes: 1 addition & 1 deletion test/parse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('Parse raw commit with custom parser', t => {
t.is(commit.shortDesc, 'First fix (fixes #123)');
});

test('Wrap parser errors in SemanticReleaseError', t => {
test('Wrap parser errors in "SemanticReleaseError"', t => {
const error = t.throws(
() => parse('Fix: First fix (fixes #123)', {headerPattern: '\\'}),
/Error in conventional-changelog-parser: Invalid regular expression:/
Expand Down

0 comments on commit e5a8c31

Please sign in to comment.