untitled notebook

node v6.17.1
version: 1.0.7
endpointsharetweet
const { JSDOM, VirtualConsole } = require('jsdom') const virtualConsole = new VirtualConsole() virtualConsole.sendTo(console) const dom = new JSDOM(` <!doctype html> <html> <body> <a class="link"></a> </body> </html> `, { url: 'http://example.com/', referrer: 'http://example.com/', contentType: 'text/html', // userAgent: 'Mellblomenator/9000', includeNodeLocations: true, virtualConsole, }) global.window = dom.window global.document = window.document global.navigator = window.navigator const link = document.querySelector('.link') link.addEventListener('click', e => { console.log('e.button should be 0', e.button) // should be 0, see: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button }) link.click()
Loading…

no comments

    sign in to comment