Skip to content

Commit 421e7be

Browse files
committed
add unit test with locationTypes as a set
1 parent d2ad4bf commit 421e7be

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/unit/utils/reportHandler.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,28 @@ describe('reportHandler.getCapabilities', () => {
248248
assert.strictEqual(caps.locationTypeLocal, true);
249249
});
250250

251+
it('should update locationTypes capabilities when locationTypes is a Set', () => {
252+
const cfg = {
253+
capabilities: {
254+
locationTypeAzure: true,
255+
locationTypeGCP: true,
256+
locationTypeDigitalOcean: true,
257+
locationTypeLocal: true,
258+
locationTypes: new Set([
259+
'location-gcp-v1',
260+
'location-file-v1',
261+
]),
262+
},
263+
supportedLifecycleRules: ['Expiration'],
264+
};
265+
const caps = getCapabilities(cfg);
266+
267+
assert.strictEqual(caps.locationTypeAzure, false);
268+
assert.strictEqual(caps.locationTypeGCP, true);
269+
assert.strictEqual(caps.locationTypeDigitalOcean, false);
270+
assert.strictEqual(caps.locationTypeLocal, true);
271+
});
272+
251273
it('should handle multiple consistency checks together', () => {
252274
process.env.LOCAL_VOLUME_CAPABILITY = '0';
253275
const cfg = {

0 commit comments

Comments
 (0)