| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4f82673 commit 68891a6
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ const { join } = require('node:path'); | |||
| 8 | 8 | ||
| 9 | 9 | const basicValidEnvFilePath = fixtures.path('dotenv/basic-valid.env'); | |
| 10 | 10 | const validEnvFilePath = fixtures.path('dotenv/valid.env'); | |
| 11 | - const missingEnvFile = fixtures.path('dotenv/non-existent-file.env'); | ||
| 11 | + const missingEnvFile = fixtures.path('dir%20with unusual"chars \'åß∂ƒ©∆¬…`/non-existent-file.env'); | ||
| 12 | 12 | ||
| 13 | 13 | describe('process.loadEnvFile()', () => { | |
| 14 | 14 | ||
@@ -85,7 +85,11 @@ describe('process.loadEnvFile()', () => { | |||
| 85 | 85 | assert.match(child.stderr, /code: 'ERR_ACCESS_DENIED'/); | |
| 86 | 86 | assert.match(child.stderr, /permission: 'FileSystemRead'/); | |
| 87 | 87 | if (!common.isWindows) { | |
| 88 | - assert(child.stderr.includes(`resource: '${JSON.stringify(missingEnvFile).replaceAll('"', '')}'`)); | ||
| 88 | + const resource = /^\s+resource: (['"])(.+)\1$/m.exec(child.stderr); | ||
| 89 | + assert(resource); | ||
| 90 | + assert.strictEqual(resource[2], resource[1] === "'" ? | ||
| 91 | + missingEnvFile.replaceAll("'", "\\'") : | ||
| 92 | + JSON.stringify(missingEnvFile).slice(1, -1)); | ||
| 89 | 93 | } | |
| 90 | 94 | assert.strictEqual(child.code, 1); | |
| 91 | 95 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments