This package is a driver for resolve-es
to emit events using memory.
import createDriver from 'resolve-bus-memory';
const driver = createDriver();
##### ./testcafe_ubuntu.dockerfile ##### | |
# Pull base image. | |
FROM ubuntu:16.04 | |
ENV LC_ALL C | |
ENV DEBIAN_FRONTEND noninteractive | |
ENV DEBCONF_NONINTERACTIVE_SEEN true | |
# Install. | |
RUN \ |
module.exports = function ({ types: t }) { | |
const WRAP_NAME = '__WRAP_OBJECT_CREATION_WITH_SOURCE_MAP__'; | |
const SOURCE_NAME = '__SOURCE_DELCARATION__'; | |
return { | |
visitor: { | |
'ObjectExpression|ArrayExpression|NewExpression': function (path, state) { | |
const wrappedParent = path.findParent( | |
parent => | |
parent.node && | |
parent.node.callee && |
(function() { | |
!(function(global) { | |
"use strict"; | |
var Op = Object.prototype; | |
var hasOwn = Op.hasOwnProperty; | |
var undefined; | |
var $Symbol = typeof Symbol === "function" ? Symbol : {}; | |
var iteratorSymbol = $Symbol.iterator || "@@iterator"; | |
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; |
const safeInvokeFs = (funcName, ...args) => | |
new Function( | |
'context', | |
`try { | |
return require('fs')[context.funcName].apply(null, context.args) | |
} catch(err) {}` | |
)({ funcName, args }) |
function conditionalRequireModuleByPath(modulePath, condition) { | |
try { | |
var packageJson = require(path.join(modulePath, './package.json')) | |
if (condition(packageJson)) { | |
return require(path.join( | |
modulePath, | |
'./', | |
packageJson.main || 'index.js' | |
)) | |
} |
window.metaEval = async (code) => { | |
const evalId = "META_EVAL_"+ Date.now() + "_" + Math.floor(Math.random() * 1000000000) | |
document.body.innerHTML += "<iframe id=\""+ evalId +"\" src=\"about:blank\"></iframe>" | |
const ifr = document.getElementById(evalId) | |
let makeResolve = null | |
const promise = new Promise((resolve) => (makeResolve = resolve)) | |
let result = null | |
const listener = (msg) => { result = msg.data; makeResolve(); } | |
window.addEventListener("message", listener) |
curl "https://api.github.com/repos/ORG/REPO/statuses/COMMIT_SHA?access_token=ACCESS_TOKEN" -H "Content-Type: application/json" -X POST -d "{\"state\": \"success\", \"context\": \"continuous-integration/drone/push\", \"target_url\": \"\"}" |
fixture`ResolveJS`.page`https://github.com/reimagined/resolve` | |
test('ResolveJS', async t => { | |
await t.setNativeDialogHandler(() => true) | |
const locationPath = (await t.eval(() => window.location)).pathname | |
await t.expect(locationPath).eql('/reimagined/resolve') | |
// await t.expect(locationPath).eql('/reimagined/resolve2') | |
}) |
fixture`HackerNews`.page`https://jd05ienjxfkjegg8mim64t8z1e.resolve.sh/` | |
test('HackerNews 1', async t => { | |
await t.setNativeDialogHandler(() => true) | |
const pageContent = (await t.eval(() => window.document.body.innerHTML)) | |
console.log(pageContent) | |
}) | |
test('HackerNews 2', async t => { | |
await t.setNativeDialogHandler(() => true) |