build: fix the build with enable_run_as_node disabled (#15711)
This commit is contained in:
		
					parent
					
						
							
								ca218b6395
							
						
					
				
			
			
				commit
				
					
						3cb9aadb80
					
				
			
		
					 5 changed files with 46 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -5,6 +5,7 @@ const fs = require('fs')
 | 
			
		|||
const { remote } = require('electron')
 | 
			
		||||
const { BrowserWindow } = remote
 | 
			
		||||
const { closeWindow } = require('./window-helpers')
 | 
			
		||||
const features = process.atomBinding('features')
 | 
			
		||||
 | 
			
		||||
const nativeModulesEnabled = remote.getGlobal('nativeModulesEnabled')
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -17,7 +18,12 @@ describe('modules support', () => {
 | 
			
		|||
        require('runas')
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
      it('can be required in node binary', (done) => {
 | 
			
		||||
      it('can be required in node binary', function (done) {
 | 
			
		||||
        if (!features.isRunAsNodeEnabled()) {
 | 
			
		||||
          this.skip()
 | 
			
		||||
          done()
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const runas = path.join(fixtures, 'module', 'runas.js')
 | 
			
		||||
        const child = require('child_process').fork(runas)
 | 
			
		||||
        child.on('message', (msg) => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue