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

jest-webextension-mock

Package Overview
Dependencies
Maintainers
1
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.8 to 3.8.9

3

__tests__/runtime.test.js

@@ -32,5 +32,6 @@ beforeEach(() => {

const path = 'TEST_PATH';
const extensionOriginURL = globalThis[Symbol.for('jest-webextension-mock')].extensionPath;
expect(jest.isMockFunction(browser.runtime.getURL)).toBe(true);
const respPath = browser.runtime.getURL(path);
expect(respPath).toEqual(path);
expect(respPath).toEqual(extensionOriginURL + path);
expect(browser.runtime.getURL).toHaveBeenCalledTimes(1);

@@ -37,0 +38,0 @@ });

'use strict';
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
enumerableOnly && (symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
_defineProperty(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, _typeof(obj);
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
// https://developer.chrome.com/extensions/omnibox

@@ -87,3 +138,4 @@ var omnibox = {

getURL: jest.fn(function (path) {
return path;
var origin = globalThis[Symbol["for"]('jest-webextension-mock')].extensionPath;
return String(new URL(path, origin));
}),

@@ -194,12 +246,2 @@ openOptionsPage: jest.fn(),

function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, _typeof(obj);
}
var store = {};

@@ -568,2 +610,5 @@

globalThis[Symbol["for"]('jest-webextension-mock')] = _objectSpread2({
extensionPath: 'moz-extension://8b413e68-1e0d-4cad-b98e-1eb000799783/'
}, globalThis[Symbol["for"]('jest-webextension-mock')]);
var chrome = {

@@ -570,0 +615,0 @@ omnibox: omnibox,

{
"name": "jest-webextension-mock",
"version": "3.8.8",
"version": "3.8.9",
"description": "Mock the components of a WebExtension",

@@ -5,0 +5,0 @@ "main": "dist/setup.js",

@@ -16,2 +16,7 @@ import { omnibox } from './omnibox';

globalThis[Symbol.for('jest-webextension-mock')] = {
extensionPath: 'moz-extension://8b413e68-1e0d-4cad-b98e-1eb000799783/',
...globalThis[Symbol.for('jest-webextension-mock')]
};
const chrome = {

@@ -18,0 +23,0 @@ omnibox,

@@ -59,3 +59,4 @@ export let onMessageListeners = [];

getURL: jest.fn(function (path) {
return path;
const origin = globalThis[Symbol.for('jest-webextension-mock')].extensionPath;
return String(new URL(path, origin));
}),

@@ -62,0 +63,0 @@ openOptionsPage: jest.fn(),

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