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

test-drive

Package Overview
Dependencies
Maintainers
3
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-drive - npm Package Compare versions

Comparing version 0.5.5 to 0.6.0

4

dist/src/index.js

@@ -13,3 +13,4 @@ "use strict";

var is_present_1 = require("./is-present");
var chaiAsPromised = require("chai-as-promised-compat");
var chaiAsPromised = require("chai-as-promised");
var chaiStyle = require("chai-style");
var sinonChai = require("sinon-chai");

@@ -24,2 +25,3 @@ var layout_1 = require("./layout");

chai.use(chaiDom);
chai.use(chaiStyle);
}

@@ -26,0 +28,0 @@ var expect = Object.assign(chai.expect.bind(chai), chai.expect);

@@ -0,6 +1,8 @@

export declare function eventSimple(target: Element, type: string, eventInitDict?: EventInit): void;
export declare function eventCompat(target: Element, type: string, eventInitDict?: EventInit): void;
export declare const event: typeof eventSimple;
export declare function change(target: Element | null, newValue: string): void;
export declare function event(target: Element, type: string, payload: any): void;
export declare const trigger: {
event: (target: Element, type: string, payload: any) => void;
event: (target: Element, type: string, eventInitDict?: EventInit | undefined) => void;
change: (target: Element | null, newValue: string) => void;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("./helpers");
function eventSimple(target, type, eventInitDict) {
var event = new Event(type, eventInitDict);
target.dispatchEvent(event);
}
exports.eventSimple = eventSimple;
// for browsers without event constructors (IE11)
function eventCompat(target, type, eventInitDict) {
var event = document.createEvent('Event');
var _a = eventInitDict || {}, _b = _a.bubbles, bubbles = _b === void 0 ? true : _b, _c = _a.cancelable, cancelable = _c === void 0 ? true : _c;
event.initEvent(type, bubbles, cancelable);
target.dispatchEvent(event);
}
exports.eventCompat = eventCompat;
exports.event = typeof Event === 'function' ? eventSimple : eventCompat;
function change(target, newValue) {

@@ -8,3 +22,3 @@ if (target) {

target.focus();
event(target, 'focus', {
exports.event(target, 'focus', {
bubbles: false,

@@ -14,7 +28,7 @@ cancelable: true

target.value = newValue;
event(target, 'input', {
exports.event(target, 'input', {
bubbles: false,
cancelable: true
});
event(target, 'change', {
exports.event(target, 'change', {
bubbles: false,

@@ -33,11 +47,6 @@ cancelable: true

exports.change = change;
function event(target, type, payload) {
var event = new Event(type, payload);
target.dispatchEvent(event);
}
exports.event = event;
exports.trigger = {
event: event,
event: exports.event,
change: change
};
//# sourceMappingURL=trigger.js.map

@@ -5,2 +5,1 @@ export declare type StateAssertionFunction = () => void;

export declare function waitForDom(domRoot: Element, assertion: DomStateAssertionFunction, timeout?: number): Promise<{}>;
export declare function isPromise(object: any): boolean;

@@ -18,4 +18,4 @@ "use strict";

var returnValue = assertion();
if (isPromise(returnValue)) {
throw new Error('Promises shouldn\'t be returned from within waitFor/waitForDom! Please refer to the docs for a more detailed explanation of usage');
if (returnValue instanceof Promise) {
return new Error('Promises shouldn\'t be returned from within waitFor/waitForDom! Please refer to the docs for a more detailed explanation of usage');
}

@@ -61,4 +61,4 @@ }

var returnValue = assertion(domRoot);
if (isPromise(returnValue)) {
throw new Error('Promises shouldn\'t be returned from within waitFor/waitForDom! Please refer to the docs for a more detailed explanation of usage');
if (returnValue instanceof Promise) {
return new Error('Promises shouldn\'t be returned from within waitFor/waitForDom! Please refer to the docs for a more detailed explanation of usage');
}

@@ -105,6 +105,2 @@ }

exports.waitForDom = waitForDom;
function isPromise(object) {
return typeof object === 'object' && 'then' in object && typeof object.then === 'function';
}
exports.isPromise = isPromise;
//# sourceMappingURL=wait-for.js.map

@@ -37,3 +37,6 @@ type VerticalAlignment = 'top' | 'center' | 'bottom';

above(value: number | Element): Assertion;
// chai-style
style(styleName: string, styleValue?: string): Assertion;
}
}
{
"name": "test-drive",
"version": "0.5.5",
"version": "0.6.0",
"description": "Opinionated library for writing web component tests",

@@ -12,3 +12,3 @@ "main": "./dist/src/index.js",

"test": "npm run test:node && npm run test:browser",
"test:node": "mocha --compilers ts:ts-node/register,tsx:ts-node/register ./test/index.node.ts",
"test:node": "mocha --require ts-node/register ./test/index.node.ts --watch-extensions ts",
"test:browser": "karma start --single-run",

@@ -18,34 +18,34 @@ "start": "webpack-dev-server --progress"

"dependencies": {
"@types/chai": "^4.0.1",
"@types/chai-as-promised": "^0.0.31",
"@types/chai": "^4.0.4",
"@types/chai-as-promised": "^7.1.0",
"@types/chai-dom": "^0.0.5",
"@types/sinon": "^2.3.3",
"@types/sinon-chai": "^2.7.28",
"chai": "^4.1.0",
"chai-as-promised-compat": "^7.0.3",
"chai-dom": "^1.5.0",
"@types/sinon": "^4.0.0",
"@types/sinon-chai": "^2.7.29",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"chai-dom": "^1.6.0",
"chai-style": "^1.0.2",
"dom-matches": "^2.0.0",
"sinon": "^2.4.1",
"sinon-chai": "^2.12.0"
"sinon": "^4.1.2",
"sinon-chai": "^2.14.0"
},
"devDependencies": {
"@types/mocha": "^2.2.41",
"core-js": "^2.4.1",
"karma": "^1.7.0",
"@types/mocha": "^2.2.44",
"core-js": "^2.5.1",
"karma": "^1.7.1",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",
"karma-mocha": "^1.3.0",
"karma-sauce-launcher": "^1.1.0",
"karma-webpack": "^2.0.4",
"mocha": "^3.4.2",
"karma-webpack": "^2.0.6",
"mocha": "^4.0.1",
"mocha-loader": "^1.1.1",
"rimraf": "^2.6.1",
"ts-loader": "^2.3.2",
"rimraf": "^2.6.2",
"ts-loader": "^3.1.1",
"ts-node": "^3.3.0",
"typescript": "^2.4.2",
"webpack": "^3.4.1",
"webpack-dev-server": "^2.6.1"
"typescript": "~2.6.1",
"webpack": "^3.8.1",
"webpack-dev-server": "^2.9.4"
},
"files": [
"dist/src",
"src",
"helpers",

@@ -52,0 +52,0 @@ "matchers.d.ts"

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