Instalación y uso de Jest con ES6
npm install --save-dev babel-jest babel-preset-env babel-core regenerator-runtime (puese que regenerator-runtime no sea necesario)
(https://jestjs.io/docs/en/configuration.html)
"jest": { "verbose": true, "testURL": "http://localhost/" }, Esto evita el error 'SecurityError: localStorage is not available for opaque origins'
"test": "jest"
"watch": "jest --watchAll *.js" -> Para hot reloading
Hacer un archivo <file_name>.test.js
npm run test
import { getById } from './utils'
import 'jest-dom/extend-expect'
it('getById', () => {
document.body.innerHTML = /*html*/`
<div class="container" id="input-container"></div>`
expect(getById('input-container').outerHTML).toBe('<div class="container" id="input-container"></div>')
})