browser-monkey
Advanced tools
Comparing version 3.0.0-beta.8 to 3.0.0-beta.9
import {Query} from './lib/Query' | ||
import IFrameMount from './lib/IFrameMount' | ||
import Mount from './lib/Mount' | ||
import ReactMount from './lib/ReactMount' | ||
import * as matchers from './lib/matchers' | ||
@@ -11,4 +10,3 @@ | ||
Mount, | ||
ReactMount, | ||
matchers, | ||
} |
@@ -1,22 +0,23 @@ | ||
const settable = | ||
'input:not([type]), ' + | ||
'input[type=text], ' + | ||
'input[type=hidden], ' + | ||
'input[type=email], ' + | ||
'input[type=password], ' + | ||
'input[type=search], ' + | ||
'input[type=tel], ' + | ||
'input[type=url], ' + | ||
'input[type=number],' + | ||
'input[type=date],' + | ||
'input[type=datetime-local],' + | ||
'input[type=month],' + | ||
'input[type=time],' + | ||
'input[type=week],' + | ||
'input[type=range],' + | ||
'textarea' | ||
module.exports = { | ||
settable, | ||
gettable: 'input,textarea', | ||
} | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var settable = 'input:not([type]), ' + | ||
'input[type=text], ' + | ||
'input[type=hidden], ' + | ||
'input[type=email], ' + | ||
'input[type=password], ' + | ||
'input[type=search], ' + | ||
'input[type=tel], ' + | ||
'input[type=url], ' + | ||
'input[type=number],' + | ||
'input[type=date],' + | ||
'input[type=datetime-local],' + | ||
'input[type=month],' + | ||
'input[type=time],' + | ||
'input[type=week],' + | ||
'input[type=range],' + | ||
'textarea'; | ||
exports.default = { | ||
settable: settable, | ||
gettable: 'input,textarea', | ||
}; | ||
//# sourceMappingURL=inputSelectors.js.map |
@@ -1,3 +0,7 @@ | ||
module.exports = function normaliseText (text) { | ||
return text.replace(/ +/g, ' ').replace(/ *\r?\n */g, '\n').trim() | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function normaliseText(text) { | ||
return text.replace(/ +/g, ' ').replace(/ *\r?\n */g, '\n').trim(); | ||
} | ||
exports.default = normaliseText; | ||
//# sourceMappingURL=normaliseText.js.map |
@@ -1,77 +0,47 @@ | ||
module.exports.MouseEvent = (function () { | ||
try { | ||
new MouseEvent('click') // eslint-disable-line | ||
return MouseEvent // eslint-disable-line | ||
} catch (e) { | ||
// Need to polyfill - fall through | ||
} | ||
const MouseEventPolyfill = function (eventType, params) { | ||
params = params || { bubbles: false, cancelable: false } | ||
var mouseEvent = document.createEvent('MouseEvent') | ||
mouseEvent.initMouseEvent( | ||
eventType, | ||
params.bubbles, | ||
params.cancelable, | ||
window, | ||
0, | ||
params.screenX || 0, | ||
params.screenY || 0, | ||
params.clientX || 0, | ||
params.clientY || 0, | ||
false, | ||
false, | ||
false, | ||
false, | ||
0, | ||
null | ||
) | ||
return mouseEvent | ||
} | ||
MouseEventPolyfill.prototype = Event.prototype | ||
return MouseEventPolyfill | ||
})() | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.KeyboardEvent = exports.MouseEvent = void 0; | ||
exports.MouseEvent = (function () { | ||
try { | ||
new exports.MouseEvent('click'); // eslint-disable-line | ||
return exports.MouseEvent; // eslint-disable-line | ||
} | ||
catch (e) { | ||
// Need to polyfill - fall through | ||
} | ||
var MouseEventPolyfill = function (eventType, params) { | ||
params = params || { bubbles: false, cancelable: false }; | ||
var mouseEvent = document.createEvent('MouseEvent'); | ||
mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, window, 0, params.screenX || 0, params.screenY || 0, params.clientX || 0, params.clientY || 0, false, false, false, false, 0, null); | ||
return mouseEvent; | ||
}; | ||
MouseEventPolyfill.prototype = Event.prototype; | ||
return MouseEventPolyfill; | ||
})(); | ||
// based on https://github.com/lifaon74/events-polyfill/blob/5ccca4002aa07f16ed1c298145f20c06d3544a29/src/constructors/KeyboardEvent.js | ||
module.exports.KeyboardEvent = (function () { | ||
try { | ||
new KeyboardEvent('keyup') // eslint-disable-line | ||
return KeyboardEvent // eslint-disable-line | ||
} catch (e) { | ||
// Need to polyfill - fall through | ||
} | ||
const KeyboardEventPolyfill = function (eventType, params) { | ||
params = params || { bubbles: true, cancelable: false } | ||
const modKeys = [ | ||
params.ctrlKey ? 'Control' : '', | ||
params.shiftKey ? 'Shift' : '', | ||
params.altKey ? 'Alt' : '', | ||
params.altGrKey ? 'AltGr' : '', | ||
params.metaKey ? 'Meta' : '' | ||
].filter(Boolean).join(' ') | ||
const keyEvent = document.createEvent('KeyboardEvent') | ||
keyEvent.initKeyboardEvent( | ||
eventType, | ||
!!params.bubbles, | ||
!!params.cancelable, | ||
window, | ||
'', | ||
params.key, | ||
0, | ||
modKeys, | ||
!!params.repeat | ||
) | ||
return keyEvent | ||
} | ||
KeyboardEventPolyfill.prototype = Event.prototype | ||
return KeyboardEventPolyfill | ||
})() | ||
exports.KeyboardEvent = (function () { | ||
try { | ||
new exports.KeyboardEvent('keyup'); // eslint-disable-line | ||
return exports.KeyboardEvent; // eslint-disable-line | ||
} | ||
catch (e) { | ||
// Need to polyfill - fall through | ||
} | ||
var KeyboardEventPolyfill = function (eventType, params) { | ||
params = params || { bubbles: true, cancelable: false }; | ||
var modKeys = [ | ||
params.ctrlKey ? 'Control' : '', | ||
params.shiftKey ? 'Shift' : '', | ||
params.altKey ? 'Alt' : '', | ||
params.altGrKey ? 'AltGr' : '', | ||
params.metaKey ? 'Meta' : '' | ||
].filter(Boolean).join(' '); | ||
var keyEvent = document.createEvent('KeyboardEvent'); | ||
// @ts-ignore | ||
keyEvent.initKeyboardEvent(eventType, !!params.bubbles, !!params.cancelable, window, '', params.key, 0, modKeys, !!params.repeat); | ||
return keyEvent; | ||
}; | ||
KeyboardEventPolyfill.prototype = Event.prototype; | ||
return KeyboardEventPolyfill; | ||
})(); | ||
//# sourceMappingURL=polyfills.js.map |
{ | ||
"name": "browser-monkey", | ||
"version": "3.0.0-beta.8", | ||
"version": "3.0.0-beta.9", | ||
"description": "reliable dom testing", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist/*", | ||
"lib/*", | ||
"test/*", | ||
"index.ts" | ||
"index.*", | ||
"*Mount.*" | ||
], | ||
@@ -15,3 +14,3 @@ "scripts": { | ||
"test-karma": "karma start --single-run", | ||
"test-electron-mocha": "yarn electron-mocha test/**/*Spec.{js,ts}", | ||
"test-electron-mocha": "yarn electron-mocha test/**/*Spec.ts", | ||
"electron-mocha": "electron-mocha --disable-site-isolation-trials --full-trace --color --main electron/foreignIframe.js -r ts-node/register --renderer", | ||
@@ -40,3 +39,3 @@ "mocha": "mocha -r test/register.js", | ||
"codesandbox-example-links": "^1.1.0", | ||
"electron": "11.0.3", | ||
"electron": "12.0.0-beta.30", | ||
"electron-mocha": "^10.0.0", | ||
@@ -43,0 +42,0 @@ "eslint": "^7.12.1", |
/* global location */ | ||
const createTestDiv = require('../../lib/createTestDiv') | ||
import createTestDiv from '../../lib/createTestDiv' | ||
const pathUtils = require('path') | ||
@@ -5,0 +5,0 @@ import retry from '../../lib/retry' |
import {Query} from '../lib/Query' | ||
import {DomAssembly} from './assemblies/DomAssembly' | ||
import ReactMount from '../lib/ReactMount' | ||
import ReactMount from '../ReactMount' | ||
import IFrameMount from '../lib/IFrameMount' | ||
@@ -8,3 +8,3 @@ import Mount from '../lib/Mount' | ||
import React from 'react' | ||
import HyperdomMount from '../lib/HyperdomMount' | ||
import HyperdomMount from '../HyperdomMount' | ||
import HyperdomApp from './app/hyperdom' | ||
@@ -11,0 +11,0 @@ |
588008
148
10679