mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[CL-525] Upgrade angular to v19 (#14815)
Upgrade Angular to v19 using the update guide. - Add `standalone: false` to any missed component in stories or tests. - Update jest.config to follow the new best practices.
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
/* eslint-env node */
|
||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
||||
const { defaultTransformerOptions } = require("jest-preset-angular/presets");
|
||||
const { createCjsPreset } = require("jest-preset-angular/presets");
|
||||
|
||||
const presetConfig = createCjsPreset({
|
||||
tsconfig: "<rootDir>/tsconfig.spec.json",
|
||||
astTransformers: {
|
||||
before: ["<rootDir>/../../libs/shared/es2020-transformer.ts"],
|
||||
},
|
||||
diagnostics: {
|
||||
ignoreCodes: ["TS151001"],
|
||||
},
|
||||
});
|
||||
|
||||
/** @type {import('jest').Config} */
|
||||
module.exports = {
|
||||
...presetConfig,
|
||||
testMatch: ["**/+(*.)+(spec).+(ts)"],
|
||||
|
||||
testPathIgnorePatterns: [
|
||||
@@ -13,23 +24,4 @@ module.exports = {
|
||||
|
||||
// Improves on-demand performance, for watches prefer 25%, overridable by setting --maxWorkers
|
||||
maxWorkers: "50%",
|
||||
|
||||
transform: {
|
||||
"^.+\\.(ts|js|mjs|svg)$": [
|
||||
"jest-preset-angular",
|
||||
{
|
||||
...defaultTransformerOptions,
|
||||
// Jest does not use tsconfig.spec.json by default
|
||||
tsconfig: "<rootDir>/tsconfig.spec.json",
|
||||
// Further workaround for memory leak, recommended here:
|
||||
// https://github.com/kulshekhar/ts-jest/issues/1967#issuecomment-697494014
|
||||
// Makes tests run faster and reduces size/rate of leak, but loses typechecking on test code
|
||||
// See https://bitwarden.atlassian.net/browse/EC-497 for more info
|
||||
isolatedModules: true,
|
||||
astTransformers: {
|
||||
before: ["<rootDir>/../../libs/shared/es2020-transformer.ts"],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user