docworks-repo
Advanced tools
Comparing version 1.3.11 to 1.4.0
@@ -312,3 +312,5 @@ 'use strict'; | ||
var removedService = (0, _collectionUtils.copy)(sRepo, { labels: (0, _collectionUtils.addRemoveLabels)(sRepo.labels, 'removed', 'new') }); | ||
messages.push('Service ' + serviceKey(removedService) + ' was removed'); | ||
if (!sRepo.labels.find(function (_) { | ||
return _ === 'removed'; | ||
})) messages.push('Service ' + serviceKey(removedService) + ' was removed'); | ||
return removedService; | ||
@@ -315,0 +317,0 @@ } |
@@ -263,3 +263,4 @@ import {zipByKey, addRemoveLabels, hasLabel, copy, compareArraysAsSets} from './collection-utils'; | ||
let removedService = copy(sRepo, {labels: addRemoveLabels(sRepo.labels, 'removed', 'new')}); | ||
messages.push(`Service ${serviceKey(removedService)} was removed`); | ||
if (!sRepo.labels.find(_ => _ === 'removed')) | ||
messages.push(`Service ${serviceKey(removedService)} was removed`); | ||
return removedService; | ||
@@ -266,0 +267,0 @@ } |
{ | ||
"name": "docworks-repo", | ||
"version": "1.3.11", | ||
"version": "1.4.0", | ||
"description": "manage service files in a git repo", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -106,2 +106,17 @@ import chai from 'chai'; | ||
it('should not re-report removed on a removed service', async function() { | ||
let emptyRepo = []; | ||
let repo = extractServices('./test/compare/repoVersion/changeServices'); | ||
// simulate existing service that is marked as removed | ||
let repoServiceA = repo.find(serviceByName('ServiceA')); | ||
repoServiceA.labels = ['removed']; | ||
let mergedRepo = merge(emptyRepo, [repoServiceA]); | ||
expect(mergedRepo.messages).to.satisfy((messages) => !messages.find(_ => _.indexOf('ServiceA') > -1)); | ||
let serviceB = mergedRepo.repo.find(serviceByName('ServiceA')); | ||
expect(serviceB.labels).to.include.members(['removed']); | ||
}); | ||
it('should remove the changed label if a service did not change', async function() { | ||
@@ -108,0 +123,0 @@ let newRepo = extractServices('./test/compare/newVersion/changeServices'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153111
4056