Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block ericmacfa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ericmacfa / DemoTestGoogle.js
Created Jul 23, 2016
View DemoTestGoogle.js
// Example adapted from the examples at
module.exports = {
'Navigate to google': function (browser) {
browser.waitForElementVisible('body', 1000);
'Try a junk selector that doesnt exist, using .elements': function (browser) {
// Note that the status is 0
ericmacfa / index.js
Last active Jul 3, 2019
fastify-session -- Request handler called even when response.redirect() is called in preHandler
View index.js
const fastify = require('fastify')();
const fastifyCookie = require('fastify-cookie');
const fastifySession = require('fastify-session');
const MemoryStore = require('memorystore')(fastifySession);
const ms = require('ms');
// region Plugins =============================================================
fastify.register(fastifySession, {
cookieName: 'id',
ericmacfa / index.js
Last active Jul 5, 2019
Fastify 1733 -- Lifecycle is not interrupted when onSend executes asynchronously
View index.js
'use strict';
const fastify = require('fastify')();
const promiseTimeout = ms =>
new Promise(resolve => {
setTimeout(resolve, ms);
// This issue occurs with both callback and promise based `onSend` hooks
View server.js
const express = require('express');
const app = express();
const router = express.Router();
const makeMockHandler = (name) => (req, res) => {
const message = `${name} --> ${req.originalUrl}`;
res.json({ handler: name });
You can’t perform that action at this time.