Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Automated API Testing using node-fetch and mocha

  • Sean Murdock
  • 2022-01-22
  • 1266
Automated API Testing using  node-fetch and mocha
  • ok logo

Скачать Automated API Testing using node-fetch and mocha бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Automated API Testing using node-fetch and mocha или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Automated API Testing using node-fetch and mocha бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Automated API Testing using node-fetch and mocha

We review briefly the three tier web architecture. Then we discuss testing the API or middle layer directly, without the browser. We write an automated API test using nodejs, mocha, and the node-fetch library.

To create an empty npm project, we click the File, New Window option in VS Code.
Then we click File, New Folder
We choose where we want the folder to live, then we name it
Now that we have our new project folder created, with click View, Terminal
In the terminal we initialize an empty NodeJS project with the command: npm init
We hit enter through all the prompts
Open the package.json file to see what it created
To see what we have so far, run the command: npm run test
Notice, there is nothing really there?
Back in the package.json file, the script called test doesn't run anything yet
Let's install mocha so we can start writing some tests: npm install mocha --save
Now we will change the scripts section in the package.json file to look like this (don't just add another "test", you need to update or remove the old one):
"scripts":{
"test":"mocha"
}
Run the command again and see what happens: npm run test
What does it say? What folder is it looking for? The test folder.
Right-click in the Explorer in VS Code and click new folder, name it test.
Now we have a test folder, but it's empty!
Right click the tests folder, and click new file. Name it login.test.js
In the login.test.js, what do we need to import to write asserts? Yep, we need the 'assert' module.
import assert from 'assert';
This is part of the mocha library you installed.
Now, write the actual test but start by creating a constant called loginToken that equals "". Do an assert.equal function call and test that loginToken.length equals 36.

Now run the test, what do you think will happen: npm run test
Why did it fail? What do we need to change?

We need to add the actual login call to the endpoint, and replace "" with a valid token. Then the length test should pass.

Finish the code by following the video, then be sure to push the code to your Github Repository.

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]