@deeeed/metamask-harness 0.26.0 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.26.2 - 2026-07-31
6
+
7
+ ### Fixed
8
+
9
+ - Verify Extension MetaMetrics consent through the production Redux store when test-only clean-state hooks are unavailable.
10
+
11
+ ## 0.26.1 - 2026-07-31
12
+
13
+ ### Fixed
14
+
15
+ - Launch an existing Extension build through the live sequencer's supported `--launch-existing-dist` flag.
16
+
5
17
  ## 0.26.0 - 2026-07-31
6
18
 
7
19
  ### Added
@@ -38,7 +38,7 @@ async function handleRuntimeLaunch({ options }) {
38
38
  target,
39
39
  "--cdp-port",
40
40
  String(cdpPort),
41
- `--${mode}`,
41
+ runtimeLaunchLiveFlag(mode),
42
42
  "--artifacts-dir",
43
43
  artifactsDir
44
44
  ];
@@ -116,6 +116,9 @@ async function handleRuntimeLaunch({ options }) {
116
116
  printRuntimeLaunchReport(report, optionFlag(options, "json"));
117
117
  return 1;
118
118
  }
119
+ function runtimeLaunchLiveFlag(mode) {
120
+ return mode === "existing-dist" ? "--launch-existing-dist" : `--${mode}`;
121
+ }
119
122
  function runtimeLaunchCommand(target, cdpPort, chromeUserDataDir, mode = "existing-dist") {
120
123
  const base = `mm-harness runtime-launch --adapter extension --target ${shellQuote(target)} --cdp-port ${cdpPort}`;
121
124
  const withMode = mode === "existing-dist" ? base : `${base} --${mode}`;
@@ -147,5 +150,6 @@ function readJsonIfExists(file) {
147
150
  }
148
151
  }
149
152
  export {
150
- handleRuntimeLaunch
153
+ handleRuntimeLaunch,
154
+ runtimeLaunchLiveFlag
151
155
  };
@@ -7,9 +7,15 @@ runAdapter((input) => withExtensionPage(input, async (page) => {
7
7
 
8
8
  async function readConsentState() {
9
9
  return page.evaluate(`(async () => {
10
- const getState = globalThis.stateHooks?.getCleanAppState;
11
- if (typeof getState !== 'function') throw new Error('stateHooks.getCleanAppState is unavailable.');
12
- const metamask = (await getState())?.metamask ?? {};
10
+ const hooks = globalThis.stateHooks || {};
11
+ const storeState = hooks.store?.getState?.();
12
+ const cleanState = typeof hooks.getCleanAppState === 'function'
13
+ ? await hooks.getCleanAppState()
14
+ : undefined;
15
+ if (!storeState && !cleanState) {
16
+ throw new Error('Extension consent state is unavailable.');
17
+ }
18
+ const metamask = storeState?.metamask ?? cleanState?.metamask ?? {};
13
19
  return {
14
20
  optedIn: Boolean(metamask.optedIn),
15
21
  dataCollectionForMarketing: Boolean(metamask.dataCollectionForMarketing),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeeed/metamask-harness",
3
- "version": "0.26.0",
3
+ "version": "0.26.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mm-harness": "bin/mm-harness"