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

electron-mocks

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-mocks - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

dist/cjs/MockView.js

14

dist/cjs/MockBrowserWindow.js

@@ -20,2 +20,3 @@ "use strict";

const MockWebContents_1 = require("./MockWebContents");
const MockView_1 = require("./MockView");
let nextId = 1;

@@ -395,2 +396,11 @@ class MockBrowserWindow extends events_1.default {

this.setTouchBar = sinon_1.default.spy();
this.showAllTabs = sinon_1.default.spy();
this.getContentView = sinon_1.default.spy();
this.setContentView = sinon_1.default.spy();
this.contentView = new MockView_1.MockView();
// new in Electron 25
this.getWindowButtonPosition = sinon_1.default.spy();
this.setWindowButtonPosition = sinon_1.default.spy();
this.setBackgroundMaterial = sinon_1.default.spy();
// needed for Electron 32
this.setBrowserView = sinon_1.default.spy();

@@ -403,6 +413,2 @@ this.getBrowserView = sinon_1.default.spy(() => null);

this.setTitleBarOverlay = sinon_1.default.spy();
// new in Electron 25
this.getWindowButtonPosition = sinon_1.default.spy();
this.setWindowButtonPosition = sinon_1.default.spy();
this.setBackgroundMaterial = sinon_1.default.spy();
this._options = {};

@@ -409,0 +415,0 @@ this.webContents = new MockWebContents_1.MockWebContents(options.webPreferences);

@@ -59,2 +59,6 @@ "use strict";

this.internal = displayId ? false : true;
// for Electron 32 update
this.detected = true;
this.maximumCursorSize = { width: 128, height: 128 };
this.nativeOrigin = { x: 0, y: 0 };
this.id = displayId++;

@@ -61,0 +65,0 @@ this.label = `Display ${this.id}`;

@@ -66,2 +66,6 @@ "use strict";

});
// for Electron 32 update
this.getCurrentBytesPerSecond = sinon.spy(() => 100);
this.getEndTime = sinon.spy(() => Date.now() + 5000);
this.getPercentComplete = sinon.spy(() => this._receivedBytes / this._totalBytes);
this._URL = url;

@@ -68,0 +72,0 @@ this._filename = url.split('?')[0].split('/').pop() || '';

@@ -14,2 +14,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { MockWebContents } from './MockWebContents';
import { MockView } from './MockView';
let nextId = 1;

@@ -389,2 +390,11 @@ export class MockBrowserWindow extends EventEmitter {

this.setTouchBar = sinon.spy();
this.showAllTabs = sinon.spy();
this.getContentView = sinon.spy();
this.setContentView = sinon.spy();
this.contentView = new MockView();
// new in Electron 25
this.getWindowButtonPosition = sinon.spy();
this.setWindowButtonPosition = sinon.spy();
this.setBackgroundMaterial = sinon.spy();
// needed for Electron 32
this.setBrowserView = sinon.spy();

@@ -397,6 +407,2 @@ this.getBrowserView = sinon.spy(() => null);

this.setTitleBarOverlay = sinon.spy();
// new in Electron 25
this.getWindowButtonPosition = sinon.spy();
this.setWindowButtonPosition = sinon.spy();
this.setBackgroundMaterial = sinon.spy();
this._options = {};

@@ -403,0 +409,0 @@ this.webContents = new MockWebContents(options.webPreferences);

@@ -56,2 +56,6 @@ let displayId = 1;

this.internal = displayId ? false : true;
// for Electron 32 update
this.detected = true;
this.maximumCursorSize = { width: 128, height: 128 };
this.nativeOrigin = { x: 0, y: 0 };
this.id = displayId++;

@@ -58,0 +62,0 @@ this.label = `Display ${this.id}`;

@@ -40,2 +40,6 @@ import * as sinon from 'sinon';

});
// for Electron 32 update
this.getCurrentBytesPerSecond = sinon.spy(() => 100);
this.getEndTime = sinon.spy(() => Date.now() + 5000);
this.getPercentComplete = sinon.spy(() => this._receivedBytes / this._totalBytes);
this._URL = url;

@@ -42,0 +46,0 @@ this._filename = url.split('?')[0].split('/').pop() || '';

@@ -6,2 +6,3 @@ /// <reference types="node" />

import EventEmitter from 'events';
import { MockView } from './MockView';
export declare class MockBrowserWindow extends EventEmitter implements BrowserWindow {

@@ -204,2 +205,9 @@ webContents: Electron.WebContents;

setTouchBar: sinon.SinonSpy<any[], any>;
showAllTabs: sinon.SinonSpy<any[], any>;
getContentView: sinon.SinonSpy<any[], any>;
setContentView: sinon.SinonSpy<any[], any>;
contentView: MockView;
getWindowButtonPosition: sinon.SinonSpy<any[], any>;
setWindowButtonPosition: sinon.SinonSpy<any[], any>;
setBackgroundMaterial: sinon.SinonSpy<any[], any>;
setBrowserView: sinon.SinonSpy<any[], any>;

@@ -212,7 +220,4 @@ getBrowserView: sinon.SinonSpy<[], any>;

setTitleBarOverlay: sinon.SinonSpy<any[], any>;
getWindowButtonPosition: sinon.SinonSpy<any[], any>;
setWindowButtonPosition: sinon.SinonSpy<any[], any>;
setBackgroundMaterial: sinon.SinonSpy<any[], any>;
private _options;
constructor(options?: Electron.BrowserWindowConstructorOptions);
}

@@ -26,4 +26,13 @@ import { Rectangle, Size } from 'electron';

label: string;
detected: boolean;
maximumCursorSize: {
width: number;
height: number;
};
nativeOrigin: {
x: number;
y: number;
};
constructor(display?: Partial<Electron.Display>);
}
export {};

@@ -35,3 +35,6 @@ /// <reference types="node" />

setSavePath: sinon.SinonSpy<[path: string], void>;
getCurrentBytesPerSecond: sinon.SinonSpy<[], number>;
getEndTime: sinon.SinonSpy<[], number>;
getPercentComplete: sinon.SinonSpy<[], number>;
constructor(url: string);
}
{
"name": "electron-mocks",
"version": "1.3.1",
"version": "1.4.0",
"description": "Testing mocks for Electron",

@@ -22,3 +22,5 @@ "repository": {

"semantic-release": "semantic-release",
"test": "mocha -r ts-node/register 'test/**/*.test.?s'"
"test": "mocha -r ts-node/register 'test/**/*.test.?s'",
"coverage": "nyc npm run test",
"type-check": "tsc --noEmit"
},

@@ -37,2 +39,3 @@ "keywords": [

"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@microsoft/api-documenter": "^7.22.33",

@@ -53,3 +56,3 @@ "@semantic-release/changelog": "^6.0.3",

"conventional-changelog-conventionalcommits": "^6.1.0",
"electron": "^26.1.0",
"electron": "^32.0.1",
"electron-mocks": "file:./",

@@ -60,2 +63,3 @@ "eslint": "^8.47.0",

"mocha": "^10.2.0",
"nyc": "^17.0.0",
"prettier": "^3.0.2",

@@ -62,0 +66,0 @@ "semantic-release": "^21.1.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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