JavaScript JavaScript Unit Testing Improving Our Tests Before and After

JavaScript Unit Testing

Quiz Question 1 of 4 Please fill in the correct answer in each blank provided below.

Steven Parker
Steven Parker
207,988 Points

:point_right: The challenge just wants you to declare the variable ship:

var ship;

1 Answer

The code below throws an error: ship is not defined. Add a line to fix the error.

describe(‘placeShip’, function () {

var ship;

beforeEach(function () {

ship = {}; 

});

it(‘places a ship’, function () {

expect(ship).to.be.ok; 

});

});