Giter Club home page Giter Club logo

-learning-node's Introduction

A passionate software developer from Argentina 🇨🇦


🔭 I’m currently working on **a Web Shop **

🌱 I’m currently learning ** Docker, GraphQL, NestJS, AWS **

💬 Ask me about NodeJS, React, Angular, TypeScrypt, MongoDB, SQL, graphQL... or anything here

⚡ Fun ** Anime, Video-Game, Cook **


⚒️ Languages-Frameworks-Tools ⚒️




⚒️ Server ⚒️




🐍 My Contributions 🐍


snake eating my contributions





⚡ Stats ⚡


streak stats readme stats
top langs





-learning-node's People

Contributors

matiasnzamora avatar

Watchers

 avatar

-learning-node's Issues

Testing Jest

Pasos para configurar Jest con TypeScript, en Node

Documentación oficial sobre Jest

  1. Instalaciones de desarrollo (super test es útil para probar Express)
npm install -D jest @types/jest ts-jest supertest
  1. Crear archivo de configuración de Jest
npx jest --init
  1. En el archivo jest.config.js configurar
preset: 'ts-jest',
testEnvironment: "jest-environment-node",

// Opcional - The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: ['dotenv/config'],
  1. Crear scripts en el package.json
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",

Node, TypeScript y Nodemon

Pasos para usar Node con TypeScript con Nodemon

Más información - Docs Oficiales

  1. Instalar TypeScript y tipos de Node, como dependencia de desarrollo
npm i -D typescript @types/node
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
  1. Opcional - Para traspilar el código, se puede usar este comando
npx tsc
npx tsc --watch
  1. Configurar Nodemon y Node-TS
npm install -D ts-node nodemon
  1. Crear archivo de configuración de Nodemon - nodemon.json
{
  "watch": ["src"],
  "ext": ".ts,.js",
  "ignore": [],
  "exec": "npx ts-node ./src/app.ts"
}
  1. Crear script para correr en desarrollo en el package.json
  "dev": "nodemon"
  "dev": "npx nodemon" // En caso de no querer instalar nodemon
  1. Instalar rimraf (Herramienta que funciona similar al rm -f) eliminar directorio
npm install -D rimraf
  1. Crear scripts en el package.json para construir e iniciar en producción
   "build": "rimraf ./dist && tsc",
   "start": "npm run build && node dist/app.js"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.