Skip to content

Commit 80f510a

Browse files
Apply suggested changes
Apply suggested changes
1 parent ed88875 commit 80f510a

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

packages/enhanced/src/lib/sharing/SharePlugin.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,6 @@ class SharePlugin {
108108
},
109109
}));
110110

111-
// Validate that at least one shared module is configured
112-
if (sharedOptions.length === 0) {
113-
throw new Error(
114-
'SharePlugin requires at least one shared module configuration',
115-
);
116-
}
117-
118111
this._shareScope = options.shareScope || 'default';
119112
this._consumes = consumes;
120113
this._provides = provides;

packages/enhanced/test/compiler-unit/sharing/SharePlugin.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,7 @@ describe('SharePlugin Compiler Integration', () => {
273273
new SharePlugin({
274274
shared: {},
275275
});
276-
}).toThrow(
277-
'SharePlugin requires at least one shared module configuration',
278-
);
276+
}).not.toThrow();
279277

280278
expect(() => {
281279
new SharePlugin({

packages/enhanced/test/unit/sharing/SharePlugin.improved.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,13 @@ describe('SharePlugin Real Behavior', () => {
287287
});
288288

289289
describe('edge cases and error handling', () => {
290-
it('should throw error for empty shared configuration', () => {
290+
it('should handle empty shared configuration', () => {
291291
expect(() => {
292292
new SharePlugin({
293293
shareScope: 'default',
294294
shared: {},
295295
});
296-
}).toThrow(
297-
'SharePlugin requires at least one shared module configuration',
298-
);
296+
}).not.toThrow();
299297
});
300298

301299
it('should handle missing shareScope with default fallback', () => {

packages/enhanced/test/unit/sharing/SharePlugin.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,12 @@ const SharePlugin = require('../../../src/lib/sharing/SharePlugin').default;
4444

4545
describe('SharePlugin', () => {
4646
describe('constructor', () => {
47-
it('should throw error for empty shared configuration', () => {
47+
it('should handle empty shared configuration', () => {
4848
expect(() => {
4949
new SharePlugin({
5050
shared: {},
5151
});
52-
}).toThrow(
53-
'SharePlugin requires at least one shared module configuration',
54-
);
52+
}).not.toThrow();
5553
});
5654

5755
it('should throw error for conflicting include/exclude filters', () => {

0 commit comments

Comments
 (0)