File tree 3 files changed +5
-13
lines changed
3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ process.on('exit', () => {
38
38
39
39
const lines = [
40
40
// This line shouldn't cause an assertion error.
41
- `require(' ${ buildPath } ' )` +
41
+ `require(${ JSON . stringify ( buildPath ) } )` +
42
42
// Log output to double check callback ran.
43
43
'.method(function(v1, v2) {' +
44
44
'console.log(\'cb_ran\'); return v1 === true && v2 === false; });' ,
Original file line number Diff line number Diff line change @@ -38,13 +38,8 @@ if (module !== require.main) {
38
38
function testProcessExit ( addonName ) {
39
39
// Make sure that process exit is clean when the instance data has
40
40
// references to JS objects.
41
- const path = require
42
- . resolve ( `./build/${ common . buildType } /${ addonName } ` )
43
- // Replace any backslashes with double backslashes because they'll be re-
44
- // interpreted back to single backslashes in the command line argument
45
- // to the child process. Windows needs this.
46
- . replace ( / \\ / g, '\\\\' ) ;
47
- const child = spawnSync ( process . execPath , [ '-e' , `require('${ path } ');` ] ) ;
41
+ const path = require . resolve ( `./build/${ common . buildType } /${ addonName } ` ) ;
42
+ const child = spawnSync ( process . execPath , [ '-e' , `require(${ JSON . stringify ( path ) } );` ] ) ;
48
43
assert . strictEqual ( child . signal , null ) ;
49
44
assert . strictEqual ( child . status , 0 ) ;
50
45
assert . strictEqual ( child . stderr . toString ( ) , 'addon_free' ) ;
Original file line number Diff line number Diff line change @@ -12,12 +12,9 @@ if (process.config.variables.node_without_node_options) {
12
12
const uvThreadPoolPath = '../../fixtures/dotenv/uv-threadpool.env' ;
13
13
14
14
// Should update UV_THREADPOOL_SIZE
15
- let filePath = path . join ( __dirname , `./build/${ common . buildType } /test_uv_threadpool_size` ) ;
16
- if ( common . isWindows ) {
17
- filePath = filePath . replaceAll ( '\\' , '\\\\' ) ;
18
- }
15
+ const filePath = path . join ( __dirname , `./build/${ common . buildType } /test_uv_threadpool_size` ) ;
19
16
const code = `
20
- const { test } = require(' ${ filePath } ' );
17
+ const { test } = require(${ JSON . stringify ( filePath ) } );
21
18
const size = parseInt(process.env.UV_THREADPOOL_SIZE, 10);
22
19
require('assert').strictEqual(size, 4);
23
20
test(size);
You can’t perform that action at this time.
0 commit comments