Skip to content

Commit 3f16e0c

Browse files
committed
mgr/dashboard: fixed unit tests
* fixed unit tests due to upgrade to angular v18 * run npm fix in order to fix code style violations * upgraded eslint/* packages' versions * fixed eslint errors and warnings Fixes: https://tracker.ceph.com/issues/68896 Signed-off-by: Ivo Almeida <[email protected]>
1 parent 6803f28 commit 3f16e0c

File tree

76 files changed

+1157
-2039
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1157
-2039
lines changed

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pybind/mgr/dashboard/frontend/cypress/tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"plugins/index.js"
77
],
88
"compilerOptions": {
9+
"typeRoots": [
10+
"../node_modules",
11+
"../node_modules/@types"
12+
],
913
"sourceMap": false,
1014
"types": [
1115
"cypress",
@@ -14,4 +18,4 @@
1418
],
1519
"target": "es6"
1620
}
17-
}
21+
}

src/pybind/mgr/dashboard/frontend/jest.config.cjs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,38 @@ const esModules = [
99
'@ng-bootstrap'
1010
];
1111
const jestConfig = {
12-
globals: {
13-
'ts-jest': {
14-
useESM: true,
15-
stringifyContentPathRegex: '\\.(html|svg)$',
16-
tsconfig: '<rootDir>/tsconfig.spec.json',
17-
isolatedModules: true
18-
}
19-
},
20-
globalSetup: 'jest-preset-angular/global-setup',
2112
moduleNameMapper: {
2213
'\\.scss$': 'identity-obj-proxy',
2314
'~/(.*)$': '<rootDir>/src/$1',
24-
'^@carbon/icons/es/(.*)$': '@carbon/icons/lib/$1.js',
15+
'^@carbon/icons/es/(.*)$': '@carbon/icons/lib/$1.js'
2516
},
2617
moduleFileExtensions: ['ts', 'html', 'js', 'json', 'mjs', 'cjs'],
2718
preset: 'jest-preset-angular',
2819
setupFilesAfterEnv: ['<rootDir>/src/setupJest.ts'],
2920
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$|'.concat(esModules.join('|'), ')')],
3021
transform: {
31-
'^.+\\.(ts|html|mjs)$': 'jest-preset-angular',
22+
'^.+\\.(ts|html|mjs)$': [
23+
'jest-preset-angular',
24+
{
25+
useESM: true,
26+
stringifyContentPathRegex: '\\.(html|svg)$',
27+
tsconfig: '<rootDir>/tsconfig.spec.json',
28+
isolatedModules: true
29+
}
30+
],
3231
'^.+\\.(js)$': 'babel-jest'
3332
},
3433
setupFiles: ['jest-canvas-mock'],
3534
coverageReporters: ['cobertura', 'html'],
36-
modulePathIgnorePatterns: ['<rootDir>/coverage/', '<rootDir>/node_modules/simplebar-angular', '<rootDir>/cypress'],
35+
modulePathIgnorePatterns: [
36+
'<rootDir>/coverage/',
37+
'<rootDir>/node_modules/simplebar-angular',
38+
'<rootDir>/cypress'
39+
],
3740
testMatch: ['**/*.spec.ts'],
38-
testRunner: 'jest-jasmine2'
41+
testRunner: 'jest-jasmine2',
42+
testEnvironmentOptions: {
43+
detectOpenHandles: true
44+
}
3945
};
4046
module.exports = jestConfig;

0 commit comments

Comments
 (0)