Here are some different ways on how to set up Jest to support ESM. This applies for Jest v25, Node v13, and Babel v7.
Node v14 and Jest v26 support ESM natively with the --experimental-vm-modules
flag.
Install cross-env
:
# for neater URLS like /{text}/{size}/{bg} | |
RewriteEngine on | |
RewriteRule ^img/([^/]+)/(\d+)/([a-fA-F0-9]{6})$ i/index.php?text=$1&size=$2&bg=$3 [NC,QSA] | |
RewriteRule ^img/([^/]+)/(\d+)$ i/index.php?text=$1&size=$2 [NC,QSA] | |
RewriteRule ^img/([^/]+)$ i/index.php?text=$1 [NC,QSA] | |
RewriteRule ^img/([^/]+)/.+$ i/index.php?text=$1 [NC,QSA] |
import React from 'react' | |
import Portal from 'react-portal' | |
import getOffsets from 'positions' | |
import { findDOMNode } from 'slate' | |
/** | |
* No-op. | |
* | |
* @type {Function} |
{ | |
"emojis": [ | |
{"emoji": "👩👩👧👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👧👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👩👩👦👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""}, | |
{"emoji": "👨👩👧👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z |
FROM ubuntu:16.04 | |
# Create a user so our program doesn't run as root. | |
RUN mkdir -p /home/chrome/ | |
RUN groupadd -r chrome &&\ | |
useradd -r -g chrome -d /home/chrome -s /sbin/nologin -G audio,video chrome | |
ENV HOME=/home/chrome |
const WebSocket = require('ws'); | |
const http = require('http'); | |
const Y = require('yjs'); | |
const wsUtils = require('./utils'); | |
const cookie = require('cookie'); | |
const QuillDelta = require('quill-delta'); | |
//const QuillConverter = require('node-quill-converter'); | |
//const MdastFromQuillDelta = require('mdast-util-from-quill-delta'); |
import * as React from "react"; | |
import { useMousePosition } from "~/hooks/useMousePosition"; | |
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
const [mouseX, mouseY] = useMousePosition(); | |
const positions = { x, y, h, w, mouseX, mouseY }; | |
return ( | |
<div |
/* | |
Replace "your_schema" with whatever schema is appropriate in your environment. | |
It is possible to use "public"... but you shouldn't! | |
*/ | |
/* | |
Function to stamp a "modified" timestamp. Adjust the name to suit your environment, | |
but that name is hard-coded so it is assumed that you only use _one_ such name. |