Skip to content

Commit c576db6

Browse files
committed
fix: Update test configuration for Angular 15 compatibility
- Replace require.context with explicit spec imports to fix webpack issues - Add lcov reporter to karma configuration
1 parent 68ebd61 commit c576db6

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

projects/ngx-ui-loader/karma.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ module.exports = function (config) {
2929
subdir: '.',
3030
reporters: [
3131
{ type: 'html' },
32-
{ type: 'text-summary' }
32+
{ type: 'text-summary' },
33+
{ type: 'lcov' }
3334
]
3435
},
3536
reporters: ['progress', 'kjhtml'],

projects/ngx-ui-loader/src/test.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,14 @@ import {
88
platformBrowserDynamicTesting,
99
} from '@angular/platform-browser-dynamic/testing';
1010

11-
declare const require: {
12-
context(
13-
path: string,
14-
deep?: boolean,
15-
filter?: RegExp
16-
): {
17-
<T>(id: string): T;
18-
keys(): string[];
19-
};
20-
};
21-
2211
// First, initialize the Angular testing environment.
2312
getTestBed().initTestEnvironment(
2413
BrowserDynamicTestingModule,
2514
platformBrowserDynamicTesting()
2615
);
2716

28-
// Then we find all the tests.
29-
const context = require.context('./', true, /\.spec\.ts$/);
30-
// And load the modules.
31-
context.keys().map(context);
17+
// Import all spec files explicitly for Angular 15 compatibility
18+
import './lib/core/ngx-ui-loader.component.spec';
19+
import './lib/core/ngx-ui-loader.service.spec';
20+
import './lib/http/ngx-ui-loader-http.interceptor.spec';
21+
import './lib/utils/functions.spec';

0 commit comments

Comments
 (0)