Repository navigation
Commit a551dfc
authored
test: run delegation packages on Vitest (#10953)
## Explanation
Moves `@metamask/delegation-controller` and
`@metamask/gator-permissions-controller` to Vitest.
## References
- https://consensyssoftware.atlassian.net/browse/WPC-1482
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
* Not applicable, test only change. Carries the `no-changelog` label.
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
* None.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Test-only and tooling changes; production controller code is
unchanged.
>
> **Overview**
> **Migrates `@metamask/delegation-controller` and
`@metamask/gator-permissions-controller` from Jest to Vitest**,
following the same package-level pattern used elsewhere in the repo
(shared `vitest.config.packages.js`, per-package `vitest.config.ts` with
prior coverage thresholds).
>
> For each package, **test scripts and devDependencies** switch to
Vitest; **Jest config and `jest` TypeScript types** are removed. Test
sources are updated mechanically (`jest` → `vi`, Vitest imports,
`vi.mock` with dynamic import in gator-permissions, `flushPromises` from
`tests/vitest/helpers.js`).
>
> **Repo wiring:** both packages are dropped from the Jest runner map in
`test-runner-package-map.cjs`, and `oxlint-suppressions.json` is
adjusted (including `vitest/no-conditional-in-test` entries for
gator-permissions tests).
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0267231. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 168fc9c commit a551dfc
21 files changed
Lines changed: 239 additions & 261 deletions
File tree
- packages
- delegation-controller
- src
- gator-permissions-controller
- src
- decodePermission
- decoders
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2151 | 2151 | | |
2152 | 2152 | | |
2153 | 2153 | | |
2154 | | - | |
2155 | | - | |
2156 | | - | |
2157 | | - | |
2158 | | - | |
2159 | 2154 | | |
2160 | 2155 | | |
2161 | 2156 | | |
| |||
2531 | 2526 | | |
2532 | 2527 | | |
2533 | 2528 | | |
2534 | | - | |
2535 | | - | |
2536 | | - | |
2537 | | - | |
2538 | | - | |
2539 | 2529 | | |
2540 | 2530 | | |
2541 | 2531 | | |
| |||
2546 | 2536 | | |
2547 | 2537 | | |
2548 | 2538 | | |
2549 | | - | |
| 2539 | + | |
2550 | 2540 | | |
2551 | 2541 | | |
2552 | 2542 | | |
| |||
2558 | 2548 | | |
2559 | 2549 | | |
2560 | 2550 | | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
2561 | 2556 | | |
2562 | 2557 | | |
2563 | 2558 | | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
2564 | 2562 | | |
2565 | 2563 | | |
2566 | 2564 | | |
2567 | 2565 | | |
2568 | | - | |
| 2566 | + | |
2569 | 2567 | | |
2570 | 2568 | | |
2571 | 2569 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | 60 | | |
62 | | - | |
63 | | - | |
64 | 61 | | |
65 | | - | |
66 | 62 | | |
67 | 63 | | |
68 | | - | |
| 64 | + | |
| 65 | + | |
69 | 66 | | |
70 | 67 | | |
71 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | | - | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 3 | | |
7 | 4 | | |
8 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | 70 | | |
72 | | - | |
73 | | - | |
74 | 71 | | |
75 | | - | |
76 | 72 | | |
77 | 73 | | |
78 | | - | |
| 74 | + | |
| 75 | + | |
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
| |||
0 commit comments