WorksheetsMocha-lvl1
Total questions: 10
Worksheet time: 5mins
What is Mocha.js primarily used for?
Transpiling ES6 code to ES5
Building web applications
Running JavaScript tests
Bundling JavaScript files
Which Mocha method is commonly used to group together related tests?
describe()
group()
bundle()
cluster()
Which function is used in Mocha to define an individual test case?
scenario()
test()
case()
it()
If you want to run a specific function before each test in a suite, which Mocha hook should you use?
beforeAll()
beforeEach()
afterAll()
duringEach()
How do you skip a test in Mocha?
Which Mocha hook runs once after all tests in a suite have completed?
beforeEnd()
postAll()
afterEach()
after()
In which file does Mocha look for tests by default if no specific path is provided?
test.js
spec.js
mocha-tests.js
test/*.js
Which assertion library is commonly paired with Mocha?
Lodash
Chai
Moment
Babel
A Mocking Library that enables unit testing by isolating individual units of code from their external dependencies
Mocha
Sinon
Chai
Jest
offers a way to express the expected outcomes of your tests in a human-readable form
Chai
Jest
Mocha
Sinon
