mirror of
https://github.com/google/blockly.git
synced 2025-12-16 06:10:12 +01:00
fix: Prevent mocha tests failures when window does not have focus. (#9332)
* chore: Add puppeteer-core as a dev dependency. * fix: Make mocha tests run in a fake-focused window. * fix: Make `test:mocha:interactive` use the same gulp codepath as `test`.
This commit is contained in:
@@ -257,9 +257,9 @@ async function metadata() {
|
||||
* Run Mocha tests inside a browser.
|
||||
* @return {Promise} Asynchronous result.
|
||||
*/
|
||||
async function mocha() {
|
||||
async function mocha(exitOnCompletion = true) {
|
||||
return runTestTask('mocha', async () => {
|
||||
const result = await runMochaTestsInBrowser().catch(e => {
|
||||
const result = await runMochaTestsInBrowser(exitOnCompletion).catch(e => {
|
||||
throw e;
|
||||
});
|
||||
if (result) {
|
||||
@@ -269,6 +269,14 @@ async function mocha() {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Run Mocha tests inside a browser and keep the browser open upon completion.
|
||||
* @return {Promise} Asynchronous result.
|
||||
*/
|
||||
export async function interactiveMocha() {
|
||||
return mocha(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for comparison file.
|
||||
* @param {string} file1 First target file.
|
||||
|
||||
Reference in New Issue
Block a user