Skip to content

Instantly share code, notes, and snippets.

@hosuaby
hosuaby / cypress-partial.js
Created December 3, 2021 20:14
Primitive load-balancer to run Cypress specs in parallel on CI without recording
/**
* Primitive load-balancer to split Cypress specs across multiple runners. This script assumes that
* all your specs are in the folder '<project root>/cypress/integration'. It uses the number of
* tests per spec file as sole criteria to split specs between runners.
*
* This script accepts two arguments: the total number of runners and the index (starting from 0) of
* the current runner. Example:
* $ node cypress-partial.js 5 2
* This command asks for specs to give to the third runner of five runners.
* The output of the script is a coma-separated list of specs that can be given to Cypress. Example:
@ianstormtaylor
ianstormtaylor / slate-node-portal.js
Created September 13, 2016 18:21
A React component example that makes it simple to position an element relative to a Slate node.
import React from 'react'
import Portal from 'react-portal'
import getOffsets from 'positions'
import { findDOMNode } from 'slate'
/**
* No-op.
*
* @type {Function}