Video upload date:  · Duration: PT1H46M27S  · Language: EN

You are working on a Node.js project that uses github video

copilot-gh-300 video for you are working on a Node.js project that uses Jest for unit testing. Your task is to write a test for a function calculateTotal() that

This is a dedicated watch page for a single video.

Full Certification Question

You are working on a Node.js project that uses Jest for unit testing. Your task is to write a test for a function calculateTotal() that takes an array of numbers and returns the sum. You have asked GitHub Copilot to assist you in generating the unit test. Below is the code generated by Copilot: // calculateTotal.js function calculateTotal ( numbers ) { return numbers . reduce (( acc , num ) => acc + num , 0 ); } module . exports = calculateTotal ; // calculateTotal.test.js (Generated by Copilot) const calculateTotal = require ( './calculateTotal' ); test ( 'calculates total sum correctly' , () => { expect ( calculateTotal ([ 1 , 2 , 3 , 4 ])). toBe ( 10 ); }); Which two of the following actions would best ensure that the generated test properly validates the calculateTotal() function and follows best testing practices? (Select two)