Read: Class 01 - 401-advanced-javascript-dania/amman-javascript-401d1 GitHub Wiki

  1. TDD in js: Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved so that the tests pass. This is opposed to software development that allows software to be added that is not proven to meet requirements. **Test-driven development (TDD) is a technique for ensuring that your code does what you think it does. It's particularly relevant for JavaScript, with its cross-browser incompatibilities and hidden gotchas. With TDD, you express your intentions twice: once as a test, and once as production code. **

2)what is npm? is the world’s largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well. npm consists of three distinct components:

  1. the website
  2. the Command Line Interface (CLI)
  3. the registry

3)npm docs: The public npm registry is a database of JavaScript packages, each comprised of software and metadata. Open source developers and developers at companies use the npm registry to contribute packages to the entire community or members of their Orgs, and download packages to use in their own projects. The npm registry contains packages, many of which are also Node modules, or contain Node modules. Read on to understand how they differ and how they interact.

About packages§ A package is a file or directory that is described by a package.json file. A package must contain a package.json file in order to be published to the npm registry. About package formats§ A package is any of the following:

a) A folder containing a program described by a package.json file. b) A gzipped tarball containing (a). c) A URL that resolves to (b). d) A @ that is published on the registry with (c). e) A @ that points to (d). f) A that has a latest tag satisfying (e). g) A git url that, when cloned, results in (a). npm package git URL formats§ Git URLs used for npm packages can be formatted in the following ways:

About modules§ A module is any file or directory in the node_modules directory that can be loaded by the Node.js require() function.

To be loaded by the Node.js require() function, a module must be one of the following:

  • A folder with a package.json file containing a "main" field.
  • A folder with an index.js file in it.
  • A JavaScript file.

4)jest docs Jest is a delightful JavaScript Testing Framework with a focus on simplicity. It works with projects using: Babel, TypeScript, Node, React, Angular, Vue and more!

Install Jest using yarn:

yarn add --dev jest Or npm: npm install --save-dev jest

Running from command line

You can run Jest directly from the CLI (if it's globally available in your PATH, e.g. by yarn global add jest or npm install jest --global) with a variety of useful options. Here's how to run Jest on files matching my-test, using config.json as a configuration file and display a native OS notification after the run: jest my-test --notify --config=config.json

⚠️ **GitHub.com Fallback** ⚠️