util: fix parseEnv handling of invalid lines #60351
Annotations
2 errors and 1 notice
Re-run test in a folder whose name contains unusual chars:
test/parallel/test-dotenv-edge-cases.js#L1
--- stdout ---
Test failure: 'should handle invalid syntax in .env file'
Location: test/parallel/test-dotenv-edge-cases.js:186:3
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
+ '[eval]:3\n' +
+ ' const input = fs.readFileSync(\'/Users/runner/work/node/node/dir%20with $unusual"chars?\'åß∂ƒ©∆¬…`/test/fixtures/dotenv/invalid-syntax.env\', \'utf8\');\n' +
+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n' +
+ " x Expected ',', got 'åß'\n" +
+ ' ,-[3:1]\n' +
+ " 1 | const { parseEnv } = require('node:util');\n" +
+ ' 2 | \n' +
+ ' 3 | const input = fs.readFileSync(\'/Users/runner/work/node/node/dir%20with $unusual"chars?\'åß∂ƒ©∆¬…`/test/fixtures/dotenv/invalid-syntax.env\', \'utf8\');\n' +
+ ' : ^^\n' +
+ ' 4 | const result = parseEnv(input);\n' +
+ ' 5 | assert.strictEqual(Object.keys(result).length, 3);\n' +
+ " 6 | assert.strictEqual(result.baz, 'whatever');\n" +
+ ' `----\n' +
+ '\n' +
+ '\n' +
+ 'SyntaxError: missing ) after argument list\n' +
+ ' at makeContextifyScript (node:internal/vm:185:14)\n' +
+ ' at compileScript (node:internal/process/execution:386:10)\n' +
+ ' at evalTypeScript (node:internal/process/execution:255:22)\n' +
+ ' at node:internal/main/eval_string:71:3\n' +
+ '\n' +
+ 'Node.js v24.0.0-pre\n'
- ''
at TestContext.<anonymous> (/Users/runner/work/node/node/dir%20with $unusual"chars?'åß∂ƒ©∆¬…`/test/parallel/test-dotenv-edge-cases.js:207:12)
at async Test.run (node:internal/test_runner/test:981:9)
at async Suite.processPendingSubtests (node:internal/test_runner/test:678:7) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: '[eval]:3\n' +
' const input = fs.readFileSync(\'/Users/runner/work/node/node/dir%20with $unusual"chars?\'åß∂ƒ©∆¬…`/test/fixtures/dotenv/invalid-syntax.env\', \'utf8\');\n' +
' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n' +
" x Expected ',', got 'åß'\n" +
' ,-[3:1]\n' +
" 1 | const { parseEnv } = require('node:util');\n" +
' 2 | \n' +
' 3 | const input = fs.readFileSync(\'/Users/runner/work/node/node/dir%20with $unusual"chars?\'åß∂ƒ©∆¬…`/test/fixtures/dotenv/invalid-syntax.env\', \'utf8\');\n' +
' : ^^\n' +
' 4 | const result = parseEnv(input);\n' +
'...',
expected: '',
operator: 'strictEqual'
}
Command: out/Release/node --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout "/Users/runner/work/node/node/dir%20with $unusual"chars?'åß∂ƒ©∆¬…`/test/parallel/test-dotenv-edge-cases.js"
|
Re-run test in a folder whose name contains unusual chars
Process completed with exit code 1.
|
Post Set up sccache
0% - 0 hits, 0 misses, 0 errors
|
Loading