freeCodeCamp/curriculum/challenges/portuguese/05-apis-and-microservices/managing-packages-with-npm/add-keywords-to-your-packag...

1.8 KiB

id title localeTitle challengeType
587d7fb4367417b2b2512bfd Add Keywords to Your package.json Adicione palavras-chave ao seu pacote.json 2

Description

O campo de palavras-chave é onde você pode descrever seu projeto usando palavras-chave relacionadas. Exemplo "keywords": [ "descriptive", "related", "words" ], Como você pode ver, este campo é estruturado como um array de strings com aspas duplas. Instruções Adicione uma matriz de strings adequadas ao campo keywords no package.json do seu projeto Glitch. Uma das palavras-chave deve ser freecodecamp.

Instructions

Tests

tests:
  - text: 'package.json deve ter uma chave "keywords" válida'
    testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data); assert(packJson.keywords, ''"keywords" is missing''); }, xhr => { throw new Error(xhr.responseText); })'
  - text: 'palavras-chave campo deve ser uma matriz '
    testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data); assert.isArray(packJson.keywords, ''"keywords" is not an array''); }, xhr => { throw new Error(xhr.responseText); })'
  - text: '"palavras-chave" devem incluir "freecodecamp"'
    testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data);     assert.include(packJson.keywords, ''freecodecamp'', ''"keywords" does not include "freecodecamp"''); },  xhr => { throw new Error(xhr.responseText); })'

Challenge Seed

Solution

// solution required