spec: fix check for electron_common_testing binding in logging-spec.ts (#30086)
This commit is contained in:
parent
19a6286dfd
commit
9959f01e4c
1 changed files with 10 additions and 1 deletions
|
@ -7,8 +7,17 @@ import * as fs from 'fs/promises';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as uuid from 'uuid';
|
import * as uuid from 'uuid';
|
||||||
|
|
||||||
|
function isTestingBindingAvailable () {
|
||||||
|
try {
|
||||||
|
process._linkedBinding('electron_common_testing');
|
||||||
|
return true;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This test depends on functions that are only available when DCHECK_IS_ON.
|
// This test depends on functions that are only available when DCHECK_IS_ON.
|
||||||
ifdescribe(process._linkedBinding('electron_common_testing'))('logging', () => {
|
ifdescribe(isTestingBindingAvailable())('logging', () => {
|
||||||
it('does not log by default', async () => {
|
it('does not log by default', async () => {
|
||||||
// ELECTRON_ENABLE_LOGGING is turned on in the appveyor config.
|
// ELECTRON_ENABLE_LOGGING is turned on in the appveyor config.
|
||||||
const { ELECTRON_ENABLE_LOGGING: _, ...envWithoutEnableLogging } = process.env;
|
const { ELECTRON_ENABLE_LOGGING: _, ...envWithoutEnableLogging } = process.env;
|
||||||
|
|
Loading…
Reference in a new issue