Question 56

A test has a dependency on database.query. During the test the dependency is replaced with an object called database with the method, query, that returns an array. The developer needs to verify how many times the method was called and the arguments used each time.
Which two test approaches describe the requirement?
Choose 2 answers
  • Question 57

    A developer wants to set up a secure web server with Node.js. The developer creates a directory locally called app-server, and the first file is app-server/index.js Without using any third-party libraries, what should the developer add to index.js to create the secure web server?
  • Question 58

    Refer to the following code:
    class Vehicle{
    constructor(plate){
    this.plate = plate;
    }
    }
    class Truck extends Vehicle{
    constructor(plate, weight){
    //Missing code
    this.weight = weight;
    }
    displayWeight(){
    console.log(`The truck ${this.plate} has a weight of ${this.weight}lb.`);
    }
    }let myTruck = new Truck('123Ab',5000);
    myTruck.displayWeight();
    Which statement should be added to missing code for the code to display 'The truck 123AB has a weight of 5000lb.
  • Question 59

    Refer to HTML below:
    <div id ="main">
    <div id = " card-00">This card is smaller.</div>
    <div id = "card-01">The width and height of this card is determined by its contents.</div>
    </div>
    Which expression outputs the screen width of the element with the ID card-01?
  • Question 60

    A Developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three number in the array, The test passes:
    Let res = sum2([1, 2, 3 ]) ;
    console.assert(res === 6 );
    Res = sum3([ 1, 2, 3, 4]);
    console.assert(res=== 6);
    A different developer made changes to the behavior of sum3 to instead sum all of the numbers present in the array. The test passes:
    Which two results occur when running the test on the updated sum3 function ?
    Choose 2 answers