UNPKG

chanjet-plugin-alert

Version:

在Mutants框架中,为chanjet平台提供读取短信的API

25 lines (18 loc) 596 B
import { jsdom } from 'jsdom' var exposedProperties = ['window', 'navigator', 'document']; global.document = jsdom('<!doctype html><html><body></body></html>'); global.window = document.defaultView; //global.navigator = global.window.navigator Object.keys(document.defaultView).forEach((property) => { if (typeof global[property] === 'undefined') { exposedProperties.push(property); global[property] = document.defaultView[property]; } }); global.navigator = { userAgent: 'node.js' }; global.cordova = { exec : function(){} }; global.documentRef = document;