jest-webextension-mock
Advanced tools
Comparing version 3.8.11 to 3.8.12
@@ -105,2 +105,18 @@ describe('browser.tabs', () => { | ||
}); | ||
test(`onRemoved.${method}`, () => { | ||
const callback = jest.fn(); | ||
expect(jest.isMockFunction(browser.tabs.onRemoved[method])).toBe(true); | ||
browser.tabs.onRemoved[method](callback); | ||
expect(browser.tabs.onRemoved[method]).toHaveBeenCalledTimes(1); | ||
expect(callback).toHaveBeenCalledTimes(0); | ||
}); | ||
test(`onCreated.${method}`, () => { | ||
const callback = jest.fn(); | ||
expect(jest.isMockFunction(browser.tabs.onCreated[method])).toBe(true); | ||
browser.tabs.onCreated[method](callback); | ||
expect(browser.tabs.onCreated[method]).toHaveBeenCalledTimes(1); | ||
expect(callback).toHaveBeenCalledTimes(0); | ||
}); | ||
}); | ||
@@ -107,0 +123,0 @@ test('reload', (done) => { |
@@ -218,2 +218,12 @@ 'use strict'; | ||
}, | ||
onRemoved: { | ||
addListener: jest.fn(), | ||
removeListener: jest.fn(), | ||
hasListener: jest.fn() | ||
}, | ||
onCreated: { | ||
addListener: jest.fn(), | ||
removeListener: jest.fn(), | ||
hasListener: jest.fn() | ||
}, | ||
sendMessage: jest.fn(function (tabId, message, cb) { | ||
@@ -220,0 +230,0 @@ onMessageListeners.forEach(function (listener) { |
{ | ||
"name": "jest-webextension-mock", | ||
"version": "3.8.11", | ||
"version": "3.8.12", | ||
"description": "Mock the components of a WebExtension", | ||
@@ -16,2 +16,3 @@ "main": "dist/setup.js", | ||
"build": "rollup -c", | ||
"release": "bumpp && npm publish", | ||
"prettier": "prettier --write \"{config,src,__{tests,setups}__}/**/*.js\" rollup.config.js", | ||
@@ -25,2 +26,3 @@ "eslint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check" | ||
"babel-jest": "^26.5.2", | ||
"bumpp": "^9.4.0", | ||
"eslint": "^7.11.0", | ||
@@ -49,4 +51,3 @@ "eslint-config-prettier": "^6.12.0", | ||
] | ||
}, | ||
"dependencies": {} | ||
} | ||
} |
[![npm](https://img.shields.io/npm/v/jest-webextension-mock.svg)](https://www.npmjs.com/package/jest-webextension-mock) [![npm](https://img.shields.io/npm/l/jest-webextension-mock.svg)](https://github.com/clarkbw/jest-webextension-mock/blob/master/LICENSE) [![Codecov](https://img.shields.io/codecov/c/github/clarkbw/jest-webextension-mock.svg)](https://codecov.io/gh/clarkbw/jest-webextension-mock) [![Greenkeeper badge](https://badges.greenkeeper.io/clarkbw/jest-webextension-mock.svg)](https://greenkeeper.io/) [![Twitter](https://img.shields.io/twitter/url/https/github.com/clarkbw/jest-webextension-mock.svg?style=social)](https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D) | ||
💪 @RickyMarou is an official maintainer. This change was made on `2024-04-12` as @clarkbw has not been able to devote sufficient time necessary for this project. | ||
## Install | ||
@@ -105,8 +103,1 @@ | ||
``` | ||
## Publish | ||
Publishing new releases is automated via the GitHub Action https://github.com/mikeal/merge-release tool. | ||
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) | ||
@@ -48,2 +48,12 @@ // https://developer.chrome.com/extensions/tabs | ||
}, | ||
onRemoved: { | ||
addListener: jest.fn(), | ||
removeListener: jest.fn(), | ||
hasListener: jest.fn(), | ||
}, | ||
onCreated: { | ||
addListener: jest.fn(), | ||
removeListener: jest.fn(), | ||
hasListener: jest.fn(), | ||
}, | ||
sendMessage: jest.fn((tabId, message, cb) => { | ||
@@ -50,0 +60,0 @@ onMessageListeners.forEach((listener) => listener(tabId, message)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2106
0
77707
14
41
103