Skip to content

Commit 17f08d0

Browse files
common: bring test coverage back to 100
1 parent 7e92d2f commit 17f08d0

1 file changed

Lines changed: 26 additions & 10 deletions

File tree

packages/common/test/util.js

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,20 +1385,36 @@ describe('common/util', function() {
13851385
var pubsub = new PubSub();
13861386
var subscription = new Subscription();
13871387

1388-
it('should match a Service type by constructor names', function() {
1389-
assert(util.isCustomType(pubsub, 'pubsub'));
1390-
});
1388+
describe('Service objects', function() {
1389+
it('should match by constructor name', function() {
1390+
assert(util.isCustomType(pubsub, 'pubsub'));
1391+
});
13911392

1392-
it('should match a ServiceObject type by constructor names', function() {
1393-
assert(util.isCustomType(subscription, 'pubsub'));
1394-
assert(util.isCustomType(subscription, 'pubsub/subscription'));
1393+
it('should support any casing', function() {
1394+
assert(util.isCustomType(pubsub, 'PubSub'));
1395+
});
13951396

1396-
assert(util.isCustomType(subscription, 'middlelayer'));
1397-
assert(util.isCustomType(subscription, 'middlelayer/subscription'));
1397+
it('should not match if the wrong Service', function() {
1398+
assert(!util.isCustomType(subscription, 'BigQuery'));
1399+
});
13981400
});
13991401

1400-
it('should support any casing', function() {
1401-
assert(util.isCustomType(subscription, 'PubSub/Subscription'));
1402+
describe('ServiceObject objects', function() {
1403+
it('should match by constructor names', function() {
1404+
assert(util.isCustomType(subscription, 'pubsub'));
1405+
assert(util.isCustomType(subscription, 'pubsub/subscription'));
1406+
1407+
assert(util.isCustomType(subscription, 'middlelayer'));
1408+
assert(util.isCustomType(subscription, 'middlelayer/subscription'));
1409+
});
1410+
1411+
it('should support any casing', function() {
1412+
assert(util.isCustomType(subscription, 'PubSub/Subscription'));
1413+
});
1414+
1415+
it('should not match if the wrong ServiceObject', function() {
1416+
assert(!util.isCustomType(subscription, 'pubsub/topic'));
1417+
});
14021418
});
14031419
});
14041420
});

0 commit comments

Comments
 (0)