mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 12:29:06 +01:00
7b35ea6400
As of #7663, an in-memory store was used in place of local storage during e2e tests, to facilitate the use of state fixtures. However, this made it difficult to export state during a test run. The instructions for exporting state to create fixtures assumed that local storage was being used. A new global function has been added to the background context to allow exporting state. This method is available during testing and development, and it works with either local storage or the in-memory store. The fixture instructions have been updated to reference this new function.
710 B
710 B
End-to-end tests
This directory contains the fixture data used to bootstrap the individual e2e tests. Each sub-directory contains one thing:
- A
state.json
file that represents a the saved state for the extension (see Generating fixture data below)
Generating fixture data
Fixture data can be generated by following these steps:
- Load the unpacked extension in development or test mode
- Inspecting the background context of the extension
- Call
metamaskGetState
, then callcopy
on the results
You can then paste the contents directly in your fixture file.
copy(await metamaskGetState())