Skip to content

Commit

Permalink
refactor: remove string concatenation (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Waller authored Oct 11, 2020
1 parent 3171a90 commit 38d17b8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ function loadSpec(arg) {
throw new Error(`Received type '${argType}'`);
} catch (error) {
throw new Error(
'The provided argument must be either an absolute filepath or ' +
`an object representing an OpenAPI specification.\nError details: ${error.message}`,
`The provided argument must be either an absolute filepath or an object representing an OpenAPI specification.\nError details: ${error.message}`,
);
}
}
Expand Down
3 changes: 1 addition & 2 deletions packages/chai-openapi-response-validator/test/setup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ const chaiResponseValidator = require('..');

const { expect } = chai;
const genericArgTypeErrMsg =
'The provided argument must be either an absolute filepath or' +
' an object representing an OpenAPI specification.\nError details: ';
'The provided argument must be either an absolute filepath or an object representing an OpenAPI specification.\nError details: ';

describe('chaiResponseValidator(pathToApiSpec)', () => {
describe('neither string nor object', () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-openapi/__test__/setup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ const fs = require('fs-extra');
const jestOpenAPI = require('..');

const genericArgTypeErrMsg =
'The provided argument must be either an absolute filepath or' +
' an object representing an OpenAPI specification.\nError details: ';
'The provided argument must be either an absolute filepath or an object representing an OpenAPI specification.\nError details: ';

describe('jestOpenAPI(pathToApiSpec)', () => {
describe('neither string nor object', () => {
Expand Down
8 changes: 5 additions & 3 deletions packages/jest-openapi/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ module.exports = function (filepathOrObject) {
} else {
// eslint-disable-next-line no-console
console.error(
"Unable to find Jest's global expect." +
'\nPlease check you have configured jest-openapi correctly.' +
'\nSee https://github.com/RuntimeTools/OpenAPIValidators/jest-openapi#usage for help.',
[
"Unable to find Jest's global expect.",
'Please check you have configured jest-openapi correctly.',
'See https://github.com/RuntimeTools/OpenAPIValidators/jest-openapi#usage for help.',
].join('\n'),
);
}
/* istanbul ignore next */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ function loadSpec(arg) {
throw new Error(`Received type '${argType}'`);
} catch (error) {
throw new Error(
'The provided argument must be either an absolute filepath or ' +
`an object representing an OpenAPI specification.\nError details: ${error.message}`,
`The provided argument must be either an absolute filepath or an object representing an OpenAPI specification.\nError details: ${error.message}`,
);
}
}
Expand Down

0 comments on commit 38d17b8

Please sign in to comment.