This recipe is loosely adapted from this NYT recipe. They come out super fluffy. It also works great for waffles. I make my own buttermilk with whole milk and white vinegar, which I'll describe below.
~8 pancakes
| Happy! | |
| ====== | |
| Personified syntax | |
| nil = # | |
| hash = @ key*value @ | |
| string = :delimiters) | |
| boolean = true S, false$ , %% and ^^or | |
| integer = V1 V2 all have Vs in front |
| import test from 'tape'; | |
| test('A passing test', (assert) => { | |
| assert.pass('This test will pass.'); | |
| assert.end(); | |
| }); | |
| test('Assertions with tape.', (assert) => { |
| test('Greet World', (assert) => new Promise((resolve) => { | |
| assert.equal(hello('World'), 'Hello, World!'); | |
| setTimeout(() => { | |
| // do some async stuff | |
| resolve(); | |
| }, 10); | |
| })); |
| const config = require('./config'); | |
| const fetch = require('node-fetch'); | |
| const querystring = require('querystring'); | |
| module.exports = { | |
| get, | |
| post, | |
| put, | |
| delete: httpDelete, // function name can't be 'delete' | |
| fetchJsonWithAuth, |
This recipe is loosely adapted from this NYT recipe. They come out super fluffy. It also works great for waffles. I make my own buttermilk with whole milk and white vinegar, which I'll describe below.
~8 pancakes
| /** | |
| * Retries a function that returns a promise a given number of times and backs | |
| * off each attempt exponentially. | |
| * | |
| * @param {Function} promiseGenerator The function to retry. | |
| * @param {number} [attempts=5] Number of attempts to make. | |
| * @param {number} [delay=1000] Initial delay between attempts in ms. | |
| * @return {Promise} | |
| */ | |
| function attemptWithRetry(promiseGenerator, attempts = 5, delay = 100) { |
| import test from 'tape'; | |
| const before = test; | |
| const after = test; | |
| // beforeEach/afterEach rely on shared state. | |
| // That's a big anti-pattern for testing. | |
| // It's also silly to run something before and after | |
| // ever test -- many of your tests won't need it. |
| export default function () { | |
| return process.env.NODE_ENV === 'development' ? ( | |
| <script src="http://localhost:35729/livereload.js?snipver=1"></script> | |
| ) : null | |
| } |