Test
AVA
Crea una nou projecte test amb compatibilitat 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 :
> test@1.0.0 test
> echo "Error: no test specified" && exit 1
Error: no test specifiedA continuació instal.lem i configurem ava:
Pots veure que s’ha modificat el fitxer 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 GoogleAmb qualsevol compte de Google. Només et demanarem que acceptis les condicions del servei.