jest-webextension-mock 3.9.1 → 4.1.0
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 +19 -0
- package/README.md +38 -2
- package/dist/setup.js +497 -375
- package/package.json +25 -16
- package/src/alarms.js +70 -0
- package/src/browserAction.js +33 -15
- package/src/downloads.js +1 -1
- package/src/extension.js +1 -1
- package/src/index.js +22 -19
- package/src/pageAction.js +23 -0
- package/src/runtime.js +5 -2
- package/src/storage.js +1 -1
- package/.babelrc +0 -5
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.eslintrc +0 -15
- package/.github/stale.yml +0 -17
- package/.github/workflows/push.yml +0 -35
- package/.vscode/settings.json +0 -4
- package/__setups__/chrome.js +0 -1
- package/__tests__/browserAction.test.js +0 -99
- package/__tests__/commands.test.js +0 -19
- package/__tests__/downloads.test.js +0 -164
- package/__tests__/extension.test.js +0 -5
- package/__tests__/geckoProfiler.test.js +0 -73
- package/__tests__/i18n.test.js +0 -11
- package/__tests__/notifications.test.js +0 -155
- package/__tests__/omnibox.test.js +0 -29
- package/__tests__/permissions.test.js +0 -39
- package/__tests__/runtime.test.js +0 -146
- package/__tests__/setup.test.js +0 -21
- package/__tests__/storage.test.js +0 -152
- package/__tests__/tabs.test.js +0 -149
- package/__tests__/webNavigation.test.js +0 -29
- package/prettier.config.js +0 -6
- package/rollup.config.js +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# jest-webextension-mock
|
|
2
2
|
|
|
3
|
+
## 4.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a9debb1: Add `browser.action` (MV3 alias for `browserAction`) and `browser.pageAction` APIs. Expand `browserAction` with missing methods (`getBadgeTextColor`, `getUserSettings`, `isEnabled`, `openPopup`, `setBadgeTextColor`) and upgrade events to use `createEventListeners()`.
|
|
8
|
+
- 68ab1a8: Add `browser.alarms` API mock with `create`, `get`, `getAll`, `clear`, `clearAll`, and `onAlarm` event.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 135c31f: Add integration runner to validate the package against external repos before publishing.
|
|
13
|
+
- 7dd6007: Overhaul CI/CD pipeline: fix broken ESLint (migrate to flat config), remove dist/ from git, enforce changeset entries on PRs, slim down published package.
|
|
14
|
+
- 7ee3b3c: Fix storage.get() returning `{ key: value }` instead of `{ [key]: value }` when retrieving a single string key.
|
|
15
|
+
|
|
16
|
+
## 4.0.0
|
|
17
|
+
|
|
18
|
+
### Major Changes
|
|
19
|
+
|
|
20
|
+
- b8594f9: Drop support for node 14 and 16, add support for node 18 and 22
|
|
21
|
+
|
|
3
22
|
## 3.9.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://www.npmjs.com/package/jest-webextension-mock) [](https://github.com/
|
|
1
|
+
[](https://www.npmjs.com/package/jest-webextension-mock) [](https://github.com/RickyMarou/jest-webextension-mock/blob/main/LICENSE) [](https://github.com/RickyMarou/jest-webextension-mock/actions/workflows/ci.yml) [](https://codecov.io/gh/RickyMarou/jest-webextension-mock)
|
|
2
2
|
|
|
3
3
|
## Install
|
|
4
4
|
|
|
@@ -96,7 +96,43 @@ it('should toggle the profiler on from stopped', () => {
|
|
|
96
96
|
|
|
97
97
|
## Development
|
|
98
98
|
|
|
99
|
-
```
|
|
99
|
+
```bash
|
|
100
100
|
npm install
|
|
101
101
|
npm test
|
|
102
102
|
```
|
|
103
|
+
|
|
104
|
+
### Linting
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm run lint
|
|
108
|
+
npm run lint:fix # auto-fix
|
|
109
|
+
npm run prettier # format code
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Contributing
|
|
113
|
+
|
|
114
|
+
PRs require a changeset entry for changelog tracking. After making your changes:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npx changeset
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Follow the prompts to describe your change (patch/minor/major). This creates a markdown file in `.changeset/` that should be committed with your PR.
|
|
121
|
+
|
|
122
|
+
For changes that don't affect the published package (CI config, docs, etc.), add an empty changeset:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npx changeset --empty
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Publishing (maintainers only)
|
|
129
|
+
|
|
130
|
+
Publishing is done locally to avoid storing npm credentials in CI.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npm run release # bumps version + updates CHANGELOG.md
|
|
134
|
+
git add -A && git commit -m "release: vX.Y.Z"
|
|
135
|
+
git push
|
|
136
|
+
npm publish # builds dist/ automatically via prepublishOnly
|
|
137
|
+
git tag vX.Y.Z && git push --tags # tag the release
|
|
138
|
+
```
|