0 I'm using mocha programmatically and I have added test files to Mocha instance as shown below. let mocha = new Mocha( ui: 'bdd', reporter: 'mochawesome' ); fs.readdirSync(testSrc) .forEach(file => mocha.addFile(path.join(testSrc, file))); mocha.run(failures => ); But in my each test js file I'm building the browser in "before" method and quitting in "after" method something like below before(async () => driver = await new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()).forBrowser('chrome').build(); await driver.manage().window().maximize(); ); after(async () => //addContext(this, 'this context is after all tests'); driver && driver.quit(); ); But the problem is "before" methods are calling simultaneously, creating multiple browsers for a file. How to get rid of this.? node.js mocha share | improve this question edited Nov 13 '18 at 7:...