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:
| /** My comments -taw -- Source location of this script: https://gist.github.com/taw00/1c014549dd649c597518e6eb4f1e3969 | |
| * To use in Google Sheets: | |
| * - Open or create Google Spreadsheet | |
| * - Click on Tools -> Script Editor | |
| * - Click Create script for Spreadsheet | |
| * - Delete the placeholder content and paste the code from this script | |
| * - Click the save button and give the project a name | |
| * - Back in the spreadsheet, in a cell, you can type “=ImportJSON()” and begin filling out it’s parameters. | |
| * Original developer: | |
| * - http://blog.fastfedora.com/projects/import-json |
| ## ===========================================================> The common stage | |
| FROM node:16.14 AS base | |
| ENV NODE_ENV=production | |
| WORKDIR /app | |
| COPY package*.json ./ | |
| RUN npm ci --only=production | |
| ## Remove unnecessary files from `node_modules` directory |
Reference link: https://www.youtube.com/watch?v=zs3tyVgiBQQ
docker build -t test .docker run -d --publish 8888:5000 test| // In Excel make sure to have this option enabled: Home / Clipboard / Options / Collect without showing the Office clipboard | |
| // Tested in Windows 10 only | |
| let table = document.querySelector('#table').outerHTML; | |
| table = table | |
| .replaceAll('\n','<br style="mso-data-placement:same-cell;"/>') // new lines inside html cells => Alt+Enter in Excel | |
| .replaceAll('<td','<td style="vertical-align: top;"'); // align top | |
| navigator.clipboard.writeText(table).then( | |
| ()=>console.log("success"), | |
| (e)=>console.log("error", e), |