Skip to content

Commit

Permalink
added tests around name field
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanm3341 committed Dec 6, 2024
1 parent 5a36780 commit 3e5b2bc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/core/messagebroker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,17 @@ describe('MessageBroker', () => {
expect(scope).not.toBe(instance);
});

it('should give the name root to the initial messagebroker instance', () => {
const instance = getInstance<IMySampleBroker>();
expect(instance.name).toBe('root');
});

it('should name child scopes correctly', () => {
const instance = getInstance<IMySampleBroker>();
const child = instance.createScope('myChild');
expect(child.name).toBe('myChild');
});

it('should return same scope if same name is used', () => {
const instance = getInstance<IMySampleBroker>();
const scope = instance.createScope('scope1');
Expand Down

0 comments on commit 3e5b2bc

Please sign in to comment.