Skip to content

Commit

Permalink
updating teh default state
Browse files Browse the repository at this point in the history
  • Loading branch information
NiranjanaBinoy committed Sep 13, 2024
1 parent effdf8b commit 22cc426
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ export type MetaMetricsDataDeletionState = {
metaMetricsDataDeletionStatus?: DeleteRegulationStatus;
};

const defaultState: MetaMetricsDataDeletionState = {
metaMetricsDataDeletionId: null,
metaMetricsDataDeletionTimestamp: 0,
const getDefaultState = (): MetaMetricsDataDeletionState => {
return {
metaMetricsDataDeletionId: null,
metaMetricsDataDeletionTimestamp: 0,
};
};

// Metadata for the controller state
Expand Down Expand Up @@ -124,7 +126,7 @@ export class MetaMetricsDataDeletionController extends BaseController<
messenger,
metadata,
name: controllerName,
state: { ...defaultState, ...state },
state: { ...getDefaultState(), ...state },
});
this.#getMetaMetricsId = getMetaMetricsId;
this.#dataDeletionService = dataDeletionService;
Expand Down
22 changes: 11 additions & 11 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
collectCoverageFrom: [
'<rootDir>/app/scripts/**/*.(js|ts|tsx)',
'<rootDir>/shared/**/*.(js|ts|tsx)',
'<rootDir>/ui/**/*.(js|ts|tsx)',
'<rootDir>/development/build/transforms/**/*.js',
'<rootDir>/test/unit-global/**/*.test.(js|ts|tsx)',
// '<rootDir>/app/scripts/**/*.(js|ts|tsx)',
// '<rootDir>/shared/**/*.(js|ts|tsx)',
// '<rootDir>/ui/**/*.(js|ts|tsx)',
// '<rootDir>/development/build/transforms/**/*.js',
// '<rootDir>/test/unit-global/**/*.test.(js|ts|tsx)',
],
coverageDirectory: './coverage',
coveragePathIgnorePatterns: ['.stories.*', '.snap'],
Expand All @@ -25,12 +25,12 @@ module.exports = {
setupFiles: ['<rootDir>/test/setup.js', '<rootDir>/test/env.js'],
setupFilesAfterEnv: ['<rootDir>/test/jest/setup.js'],
testMatch: [
'<rootDir>/app/scripts/**/*.test.(js|ts|tsx)',
'<rootDir>/shared/**/*.test.(js|ts|tsx)',
'<rootDir>/ui/**/*.test.(js|ts|tsx)',
'<rootDir>/development/**/*.test.(js|ts|tsx)',
'<rootDir>/test/unit-global/**/*.test.(js|ts|tsx)',
'<rootDir>/test/e2e/helpers.test.js',
'<rootDir>/app/scripts/controllers/metametrics-data-deletion/metametrics-data-deletion.test.ts',
// '<rootDir>/shared/**/*.test.(js|ts|tsx)',
// '<rootDir>/ui/**/*.test.(js|ts|tsx)',
// '<rootDir>/development/**/*.test.(js|ts|tsx)',
// '<rootDir>/test/unit-global/**/*.test.(js|ts|tsx)',
// '<rootDir>/test/e2e/helpers.test.js',
],
testPathIgnorePatterns: ['<rootDir>/development/webpack/'],
testTimeout: 5500,
Expand Down

0 comments on commit 22cc426

Please sign in to comment.