jest-webextension-mock 3.7.22 → 3.8.1
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/.github/workflows/publish.yml +21 -21
- package/.github/workflows/push.yml +20 -21
- package/README.md +3 -14
- package/__tests__/runtime.test.js +5 -0
- package/package.json +1 -1
- package/src/runtime.js +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
on:
|
|
2
2
|
push:
|
|
3
3
|
branches:
|
|
4
|
-
-
|
|
4
|
+
- main
|
|
5
5
|
|
|
6
6
|
name: Publish
|
|
7
7
|
|
|
@@ -10,23 +10,23 @@ jobs:
|
|
|
10
10
|
name: Publish
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
steps:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
- uses: actions/checkout@v2
|
|
14
|
+
- name: Get yarn cache directory path
|
|
15
|
+
id: yarn-cache-dir-path
|
|
16
|
+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
|
17
|
+
- uses: actions/cache@v2
|
|
18
|
+
id: yarn-cache
|
|
19
|
+
with:
|
|
20
|
+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
21
|
+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
22
|
+
restore-keys: ${{ runner.os }}-yarn-
|
|
23
|
+
- name: Yarn Install
|
|
24
|
+
run: yarn install
|
|
25
|
+
- name: Yarn Test
|
|
26
|
+
run: yarn test
|
|
27
|
+
- name: Publish
|
|
28
|
+
if: github.ref == 'refs/heads/main'
|
|
29
|
+
uses: mikeal/merge-release@master
|
|
30
|
+
env:
|
|
31
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
32
|
+
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
@@ -2,34 +2,33 @@ name: Build and Test
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches: [
|
|
5
|
+
branches: [main]
|
|
6
6
|
pull_request:
|
|
7
|
-
branches: [
|
|
7
|
+
branches: [main]
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
10
|
build:
|
|
11
|
-
|
|
12
11
|
runs-on: ubuntu-latest
|
|
13
12
|
|
|
14
13
|
strategy:
|
|
15
14
|
matrix:
|
|
16
|
-
node-version: [
|
|
15
|
+
node-version: [14.x, 16.x, 18.x]
|
|
17
16
|
|
|
18
17
|
steps:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
- uses: actions/checkout@v2
|
|
19
|
+
- name: Get yarn cache directory path
|
|
20
|
+
id: yarn-cache-dir-path
|
|
21
|
+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
|
22
|
+
- uses: actions/cache@v2
|
|
23
|
+
id: yarn-cache
|
|
24
|
+
with:
|
|
25
|
+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
26
|
+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
27
|
+
restore-keys: ${{ runner.os }}-yarn-
|
|
28
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
29
|
+
uses: actions/setup-node@v1
|
|
30
|
+
with:
|
|
31
|
+
node-version: ${{ matrix.node-version }}
|
|
32
|
+
- run: yarn install
|
|
33
|
+
- run: yarn test
|
|
34
|
+
- uses: codecov/codecov-action@v1
|
package/README.md
CHANGED
|
@@ -104,18 +104,7 @@ yarn test
|
|
|
104
104
|
|
|
105
105
|
## Publish
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Publishing new releases is automated via the GitHub Action https://github.com/mikeal/merge-release tool.
|
|
108
|
+
|
|
109
|
+
To ensure your feature is properly released prefix your commit message with `feat` for any new feature. For example: `feat: new API` and this will bump the minor release number. All other changes will be assumed as patch releases unless you include the string `BREAKING CHANGE` in your commit message or description which will trigger a new major release. (do not do this unless absolutely required)
|
|
108
110
|
|
|
109
|
-
```
|
|
110
|
-
git checkout -b new-release
|
|
111
|
-
yarn run build
|
|
112
|
-
yarn run prettier
|
|
113
|
-
git commit -a -m 'updating to the latest build release'
|
|
114
|
-
# merge pull request, delete branch
|
|
115
|
-
git checkout master
|
|
116
|
-
git pull
|
|
117
|
-
npm version `${version}`
|
|
118
|
-
npm publish
|
|
119
|
-
git push --tags
|
|
120
|
-
## edit release notes
|
|
121
|
-
```
|
|
@@ -137,4 +137,9 @@ describe('browser.runtime', () => {
|
|
|
137
137
|
browser.runtime.openOptionsPage();
|
|
138
138
|
expect(browser.runtime.openOptionsPage).toHaveBeenCalledTimes(1);
|
|
139
139
|
});
|
|
140
|
+
test('getManifest', () => {
|
|
141
|
+
expect(jest.isMockFunction(browser.runtime.getManifest)).toBe(true);
|
|
142
|
+
expect(browser.runtime.getManifest()).toEqual({ manifest_version: 3 });
|
|
143
|
+
expect(browser.runtime.getManifest).toHaveBeenCalledTimes(1);
|
|
144
|
+
});
|
|
140
145
|
});
|
package/package.json
CHANGED