Skip to content

Commit

Permalink
🎨 Faire un bump de version mineure par défaut
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 3, 2023
2 parents 8086968 + 7170d40 commit aa3d8ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
14 changes: 2 additions & 12 deletions run/services/slack/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,7 @@ function _isReleaseTypeInvalid(releaseType) {
}
async function publishAndDeployPixUI(repoName, releaseType, responseUrl) {
if (_isReleaseTypeInvalid(releaseType)) {
slackPostMessageService.postMessage(
'Erreur lors du choix de la nouvelle version de Pix UI. Veuillez indiquer "major", "minor" ou "patch".'
);
throw new Error(
'Erreur lors du choix de la nouvelle version de Pix UI. Veuillez indiquer "major", "minor" ou "patch".'
);
releaseType = 'minor';
}
const releaseTagBeforeRelease = await githubServices.getLatestReleaseTag(repoName);
await releasesService.publishPixRepo(repoName, releaseType);
Expand All @@ -85,12 +80,7 @@ async function publishAndDeployPixUI(repoName, releaseType, responseUrl) {

async function publishAndDeployEmberTestingLibrary(repoName, releaseType, responseUrl) {
if (_isReleaseTypeInvalid(releaseType)) {
slackPostMessageService.postMessage(
'Erreur lors du choix de la nouvelle version d\'ember-testing-library. Veuillez indiquer "major", "minor" ou "patch".'
);
throw new Error(
'Erreur lors du choix de la nouvelle version d\'ember-testing-library. Veuillez indiquer "major", "minor" ou "patch".'
);
releaseType = 'minor';
}
const releaseTagBeforeRelease = await githubServices.getLatestReleaseTag(repoName);
await releasesService.publishPixRepo(repoName, releaseType);
Expand Down
12 changes: 6 additions & 6 deletions test/unit/run/services/slack/commands_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ describe('Services | Slack | Commands', () => {
sinon.assert.calledWith(githubServices.getLatestReleaseTag, 'pix-ui');
});

it('should stop release if no version is given', async () => {
it('should create a minor version if no version is given', async () => {
// given
const payload = { text: '' };

// when
const response = await catchErr(createAndDeployPixUI)(payload);
await createAndDeployPixUI(payload);

// then
expect(response).to.be.instanceOf(Error);
sinon.assert.calledWith(releasesServices.publishPixRepo, 'pix-ui', 'minor');
});
});

Expand All @@ -143,15 +143,15 @@ describe('Services | Slack | Commands', () => {
sinon.assert.calledWith(githubServices.getLatestReleaseTag, 'ember-testing-library');
});

it('should stop release if no version is given', async () => {
it('should create a minor version if no version is given', async () => {
// given
const payload = { text: '' };

// when
const response = await catchErr(createAndDeployEmberTestingLibrary)(payload);
await createAndDeployEmberTestingLibrary(payload);

// then
expect(response).to.be.instanceOf(Error);
sinon.assert.calledWith(releasesServices.publishPixRepo, 'ember-testing-library', 'minor');
});
});

Expand Down

0 comments on commit aa3d8ee

Please sign in to comment.