logo

Crowdly

Browser

Add to Chrome

Розробка сучасних вебзастосунків на платформі Node.js

Looking for Розробка сучасних вебзастосунків на платформі Node.js test answers and solutions? Browse our comprehensive collection of verified answers for Розробка сучасних вебзастосунків на платформі Node.js at learn.ztu.edu.ua.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Тестування

Студент пише:

const tags = [];

tags.push('typescript');

Компілятор TypeScript видає помилку на другому рядку. Чому це відбувається і як це виправити?

0%
0%
0%
0%
100%
View this question

Тестування

Дано функцію:

function getId<T extends { id: string }>(e: T): string {

return e.id;

}

Який виклик створить помилку компіляції?

100%
0%
0%
0%
0%
View this question

Тестування

Функція fetchUser асинхронна і кидає помилку для невалідного id. Який тест коректно її перевіряє?

0%
0%
0%
100%
0%
View this question

Тестування

Який тест пройде успішно?

const user = { name: 'John', age: 25 };
100%
0%
0%
0%
0%
View this question

Тестування

Дано:

beforeEach(() => log('outer'));

describe('inner', () => {

beforeEach(() => log('inner'));

test('t', () => log('test'));

});

Який порядок у консолі для тесту t?

0%
0%
100%
0%
0%
View this question

Тестування

Функція retryOperation повторює виклики функції з якоюсь затримкою. Використовуємо fake timers. У якому з цих варіантів обробник помилки ПРИЄДНАНО коректно?

const promise = retryOperation(op, 3);
100%
0%
0%
0%
0%
View this question

Тестування

Дано:

const fn = jest.fn();

fn.mockReturnValue(42);

fn.mockReturnValueOnce(100);

console.log(fn(), fn(), fn());

Який результат виведе console.log?

0%
100%
0%
0%
0%
View this question

Тестування

Лабораторна вимагає 100% покриття коду тестами. Функція retryOperation(op, maxRetries = 3) має дефолтний параметр. Що треба явно перевірити для повного покриття гілок?

100%
0%
0%
0%
View this question

Тестування

Які з наведених залежностей МАЮТЬ бути у devDependencies, а не у dependencies?

axios, express, jest, ts-jest, @types/jest
100%
0%
0%
0%
0%
View this question

Node.js

Який порядок виведення у цьому коді?

async function f() {

try { console.log('1'); return 'done'; }

catch { console.log('2'); }

finally { console.log('3'); }

}

f().then(v => console.log(v));

100%
0%
0%
0%
0%
View this question

Want instant access to all verified answers on learn.ztu.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome