Escriu per cercar…

Test

AVA

AVA

Crea una nou projecte test amb compatibilitat esm:

shell
mkdir test && cd test
npm init -y esm
Wrote to /home/david/test/package.json:

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}

Pots veure que s’ha creat un fitxer package.json.

Si executem npm run test es produirà un error perqué l’script amb index test executa ... && exit 1 tal com pots veure en la definició del fitxer package.json :

shell
npm run test

> test@1.0.0 test
> echo "Error: no test specified" && exit 1

Error: no test specified

A continuació instal.lem i configurem ava:

shell
npm init ava

Pots veure que s’ha modificat el fitxer package.json:

shell
cat package.json 
{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "module": "main.js",
  "scripts": {
    "test": "ava"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "esm": "^3.2.25"
  },
  "devDependencies": {
    "ava": "^6.1.3"
  }
}

Estàs llegint una vista prèvia.

Inicia sessió amb Google per llegir la pàgina completa.

Inicia sessió amb Google

Amb qualsevol compte de Google. Només et demanarem que acceptis les condicions del servei.