Skip to content

Commit 0df6250

Browse files
test: Apply suggestions from code review
Co-authored-by: Antoine du Hamel <[email protected]>
1 parent 5eff71c commit 0df6250

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/parallel/test-dotenv-edge-cases.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ describe('.env supports edge cases', () => {
202202
});
203203

204204
it('should handle invalid syntax in .env file', async () => {
205-
const invalidEnvFilePath = path.resolve(__dirname, '../fixtures/dotenv/invalid-syntax.env');
205+
const invalidEnvFilePath = fixtures.path('dotenv/invalid-syntax.env');
206206
const code = `
207207
const { parseEnv } = require('node:util');
208208
209-
const input = fs.readFileSync('${invalidEnvFilePath}', 'utf8');
209+
const input = fs.readFileSync(${JSON.stringify(invalidEnvFilePath)}, 'utf8');
210210
const result = parseEnv(input);
211211
assert.strictEqual(Object.keys(result).length, 3);
212212
assert.strictEqual(result.baz, 'whatever');
@@ -223,6 +223,7 @@ describe('.env supports edge cases', () => {
223223
{ cwd: __dirname },
224224
);
225225
assert.strictEqual(child.stderr, '');
226+
assert.strictEqual(child.stdout, '');
226227
assert.strictEqual(child.code, 0);
227228
});
228229
});

0 commit comments

Comments
 (0)