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.
@@ -1,7 +1,7 @@
1
1
  on:
2
2
  push:
3
3
  branches:
4
- - master
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
- - 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/master'
29
- uses: mikeal/merge-release@master
30
- env:
31
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
- NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
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: [ master ]
5
+ branches: [main]
6
6
  pull_request:
7
- branches: [ master ]
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: [10.x, 12.x, 14.x]
15
+ node-version: [14.x, 16.x, 18.x]
17
16
 
18
17
  steps:
19
- - uses: actions/checkout@v2
20
- - name: Get yarn cache directory path
21
- id: yarn-cache-dir-path
22
- run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
23
- - uses: actions/cache@v2
24
- id: yarn-cache
25
- with:
26
- path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
27
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
28
- restore-keys: ${{ runner.os }}-yarn-
29
- - name: Use Node.js ${{ matrix.node-version }}
30
- uses: actions/setup-node@v1
31
- with:
32
- node-version: ${{ matrix.node-version }}
33
- - run: yarn install
34
- - run: yarn test
35
- - uses: codecov/codecov-action@v1
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
- To publish a new release, follow these steps:
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-webextension-mock",
3
- "version": "3.7.22",
3
+ "version": "3.8.1",
4
4
  "description": "Mock the components of a WebExtension",
5
5
  "main": "dist/setup.js",
6
6
  "module": "src/setup.js",
package/src/runtime.js CHANGED
@@ -59,4 +59,5 @@ export const runtime = {
59
59
  return path;
60
60
  }),
61
61
  openOptionsPage: jest.fn(),
62
+ getManifest: jest.fn(() => ({ manifest_version: 3 })),
62
63
  };