-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! test: improve
UV_THREADPOOL_SIZE
tests on .env
- Loading branch information
Showing
2 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
|
||
const common = require('../../common'); | ||
const assert = require('node:assert'); | ||
const path = require('node:path'); | ||
const { describe, it } = require('node:test'); | ||
|
||
if (process.config.variables.node_without_node_options) { | ||
common.skip('missing NODE_OPTIONS support'); | ||
} | ||
|
||
const uvThreadPoolPath = '../../fixtures/dotenv/uv-threadpool.env'; | ||
|
||
describe('.env supports NODE_OPTIONS', () => { | ||
|
||
it('should update UV_THREADPOOL_SIZE', async () => { | ||
const filePath = path.join(__dirname, `./build/${common.buildType}/test_uv_threadpool_size`); | ||
const code = ` | ||
const { test } = require('${filePath}'); | ||
const size = parseInt(process.env.UV_THREADPOOL_SIZE, 10); | ||
require('assert').strictEqual(size, 5); | ||
test(size); | ||
`.trim(); | ||
const child = await common.spawnPromisified( | ||
process.execPath, | ||
[ `--env-file=${uvThreadPoolPath}`, '--eval', code ], | ||
{ cwd: __dirname }, | ||
); | ||
assert.strictEqual(child.stderr, ''); | ||
assert.strictEqual(child.code, 0); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters