This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const router = express.Router(); | |
const makeMockHandler = (name) => (req, res) => { | |
const message = `${name} --> ${req.originalUrl}`; | |
console.log(message); | |
res.json({ handler: name }); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(fastifyCookie); | |
fastify.register(fastifySession, { | |
cookieName: 'id', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example adapted from the examples at http://nightwatchjs.org/guide#writing-tests | |
module.exports = { | |
'Navigate to google': function (browser) { | |
browser.windowMaximize(); | |
browser.url('http://www.google.com'); | |
browser.waitForElementVisible('body', 1000); | |
}, | |
'Try a junk selector that doesnt exist, using .elements': function (browser) { | |
// Note that the status is 0 |