Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

jest-webextension-mock

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-webextension-mock - npm Package Compare versions

Comparing version 3.8.11 to 3.8.12

16

__tests__/tabs.test.js

@@ -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) {

7

package.json
{
"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));

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc