Skip to content

Commit 4e661d1

Browse files
committed
[AUTOMATED]: Prettier Code Styling
1 parent 917322c commit 4e661d1

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

packages/component/src/provider.test.ts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,38 @@ describe('Provider', () => {
5050
});
5151

5252
it('does not throw if instance factory throws when calling getImmediate() with optional flag', () => {
53-
provider.setComponent(getFakeComponent('test', () => { throw Error('something went wrong!'); }));
53+
provider.setComponent(
54+
getFakeComponent('test', () => {
55+
throw Error('something went wrong!');
56+
})
57+
);
5458
expect(() => provider.getImmediate({ optional: true })).to.not.throw();
5559
});
5660

5761
it('throws if instance factory throws when calling getImmediate() without optional flag', () => {
58-
provider.setComponent(getFakeComponent('test', () => { throw Error('something went wrong!'); }));
62+
provider.setComponent(
63+
getFakeComponent('test', () => {
64+
throw Error('something went wrong!');
65+
})
66+
);
5967
expect(() => provider.getImmediate()).to.throw();
6068
});
6169

6270
it('does not throw if instance factory throws when calling get()', () => {
63-
provider.setComponent(getFakeComponent('test', () => { throw Error('something went wrong!'); }));
71+
provider.setComponent(
72+
getFakeComponent('test', () => {
73+
throw Error('something went wrong!');
74+
})
75+
);
6476
expect(() => provider.get()).to.not.throw();
6577
});
6678

6779
it('does not throw if instance factory throws when registering an eager component', () => {
6880
const eagerComponent = getFakeComponent(
6981
'test',
70-
() => { throw Error('something went wrong!'); },
82+
() => {
83+
throw Error('something went wrong!');
84+
},
7185
false,
7286
InstantiationMode.EAGER
7387
);
@@ -79,7 +93,9 @@ describe('Provider', () => {
7993
// create a pending promise
8094
// eslint-disable-next-line @typescript-eslint/no-floating-promises
8195
provider.get();
82-
const component = getFakeComponent('test', () => { throw Error('something went wrong!'); });
96+
const component = getFakeComponent('test', () => {
97+
throw Error('something went wrong!');
98+
});
8399
expect(() => provider.setComponent(component)).to.not.throw();
84100
});
85101

packages/component/src/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class Provider<T extends Name> {
3636
constructor(
3737
private readonly name: T,
3838
private readonly container: ComponentContainer
39-
) { }
39+
) {}
4040

4141
/**
4242
* @param identifier A provider can provide mulitple instances of a service
@@ -128,7 +128,7 @@ export class Provider<T extends Name> {
128128
try {
129129
this.getOrInitializeService(DEFAULT_ENTRY_NAME);
130130
} catch (e) {
131-
// when the instance factory for an eager Component throws an exception during the eager
131+
// when the instance factory for an eager Component throws an exception during the eager
132132
// initialization, it should not cause an fatal error.
133133
// TODO: Investigate if we need to make it configurable, because some component may want to cause
134134
// a fatal error in this case?

0 commit comments

Comments
 (0)