Documentación oficial sobre Jest
- Instalaciones de desarrollo (super test es útil para probar Express)
npm install -D jest @types/jest ts-jest supertest
Documentación oficial sobre Jest
npm install -D jest @types/jest ts-jest supertest
Más información - Docs Oficiales
npm i -D typescript @types/node
| # Editor configuration, see https://editorconfig.org | |
| root = true | |
| [*] | |
| charset = utf-8 | |
| indent_style = space | |
| indent_size = 4 | |
| insert_final_newline = true | |
| trim_trailing_whitespace = true |
| @mixin min-width-576 { | |
| @media (min-width: 576px) { | |
| @content; | |
| } | |
| } | |
| @mixin min-width-768 { | |
| @media (min-width: 768px) { | |
| @content; | |
| } |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| <style> | |
| .switch { | |
| position: relative; |
| const express = require('express'); | |
| const path = require('path'); | |
| const open = require('open'); | |
| class Server { | |
| constructor(port, app) { | |
| this.port = port; | |
| this.app = app; | |
| } | |
| get() { |
| const smoothScroll = element => | |
| document.querySelector(element).scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| smoothScroll('#fooBar'); // scrolls smoothly to the element with the id fooBar | |
| smoothScroll('.fooBar'); // scrolls smoothly to the first element with a class of fooBar |
| const isRequired = () => { throw new Error('param is required'); }; | |
| const hello = (name = isRequired()) => { console.log(`hello ${name}`) }; | |
| // This will throw an error because no name is provided | |
| hello(); | |
| // This will also throw an error | |
| hello(undefined); |
| <div class="donut"></div> |