/node-typescript-mocha

Template for Node Typescript TDD projects in VS Code

Primary LanguageJavaScriptMIT LicenseMIT

This is a template for NodeJS TypeScript Mocha based TDD projects

This template provides:

  • a devcontainer for an consistent environment
  • linting and formatting via eslint
  • mocha test which are executed on save

Repo Structure

The intended structure:

src/ 
  - foo.ts
  - <code>

test/
  - foo.test.ts
  - <tests>

dist/
  - foo.js
  - <compiled js>

Enable autorun

  • Open the vs code tab test
  • Click on ...
  • Select Enable autorun

Conventions

Names

Be explicit! Do not use add words like manager to a class name if not realy needed. Bad example: [1] The world seen by an "Object-Oriented" programmer

Try to use get and set as less as possible, because they do not add meaning. [1]

Generell

Structure

Do not bypass the encapsularion layer, becuase otherwise the meaning of an object is lost. [1]

Use undefined instead of null whenever possible. [2]

Setup origin

This setup originates from the following sources: