Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2464 from bbc/changescanner-explanation
Browse files Browse the repository at this point in the history
Add explanation to changeScanner error output
  • Loading branch information
jamesdonoh authored Oct 23, 2019
2 parents d1a7ef3 + 775077d commit 4dccd4d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 1.8.30 | [PR#2464](https://github.com/bbc/psammead/pull/2464) Add more context to changeScanner error output |
| 1.8.29 | [PR#2317](https://github.com/bbc/psammead/pull/2317) Bump @bbc/psammead-media-player |
| 1.8.28 | [PR#2452](https://github.com/bbc/psammead/pull/2452) Bump dependencies (#2441 - #2445) |
| 1.8.27 | [PR#2400](https://github.com/bbc/psammead/pull/2400) bump dependencies (#2385 - #2396) |
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead",
"version": "1.8.29",
"version": "1.8.30",
"description": "Core Components Library Developed & Maintained By The Articles and Reach & Languages Team",
"main": "index.js",
"private": true,
Expand Down
3 changes: 3 additions & 0 deletions scripts/changeScanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Object.keys(changes).forEach(packageName => {

/* eslint-disable no-console */
if (errors.length > 0) {
console.error(`Please update the version number and CHANGELOG for every package that is being
changed in this branch. The following problems were found:
`);
errors.forEach(error => console.error(chalk.red(error)));
console.error(''); // empty line for spacing
process.exit(1);
Expand Down
8 changes: 6 additions & 2 deletions scripts/changeScanner/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ describe(`changeScanner - index`, () => {
'', // empty line for spacing
];

expect(consoleLogOutput).not.toHaveBeenCalled();
expect(consoleErrorOutput).toHaveBeenCalledTimes(
expectedMessages.length + 1,
);

expect(consoleErrorOutput).toHaveBeenCalledTimes(expectedMessages.length);
expect(consoleErrorOutput).toHaveBeenCalledWith(
expect.stringContaining('Please update the version number'),
);

expectedMessages.forEach(msg =>
expect(consoleErrorOutput).toHaveBeenCalledWith(msg),
Expand Down

0 comments on commit 4dccd4d

Please sign in to comment.