Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Mocha-lvl1

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is Mocha.js primarily used for?

a)

Transpiling ES6 code to ES5

b)

Building web applications

c)

Running JavaScript tests

d)

Bundling JavaScript files

2.

Which Mocha method is commonly used to group together related tests?

a)

describe()

b)

group()

c)

bundle()

d)

cluster()

3.

Which function is used in Mocha to define an individual test case?

a)

scenario()

b)

test()

c)

case()

d)

it()

4.

If you want to run a specific function before each test in a suite, which Mocha hook should you use?

a)

beforeAll()

b)

beforeEach()

c)

afterAll()

d)

duringEach()

5.

How do you skip a test in Mocha?

b)

it.skip()

d)

it.ignore()

6.

Which Mocha hook runs once after all tests in a suite have completed?

a)

beforeEnd()

b)

postAll()

c)

afterEach()

d)

after()

7.

In which file does Mocha look for tests by default if no specific path is provided?

a)

test.js

b)

spec.js

c)

mocha-tests.js

d)

test/*.js

8.

Which assertion library is commonly paired with Mocha?

a)

Lodash

b)

Chai

c)

Moment

d)

Babel

9.

A Mocking Library that enables unit testing by isolating individual units of code from their external dependencies

a)

Mocha

b)

Sinon

c)

Chai

d)

Jest

10.

offers a way to express the expected outcomes of your tests in a human-readable form

a)

Chai

b)

Jest

c)

Mocha

d)

Sinon