| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 85f062c commit 7e34aa4
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -361,7 +361,10 @@ test('should override node.config.json when specificied', async () => { | |||
| 361 | 361 | strictEqual(result.code, 0); | |
| 362 | 362 | }); | |
| 363 | 363 | // Skip on windows because it doesn't support chmod changing read permissions | |
| 364 | - test('should throw an error when the file is non readable', { skip: common.isWindows }, async () => { | ||
| 364 | + // Also skip if user is root because it would have read permissions anyway | ||
| 365 | + test('should throw an error when the file is non readable', { | ||
| 366 | + skip: common.isWindows || process.getuid() === 0, | ||
| 367 | + }, async () => { | ||
| 365 | 368 | chmodSync(fixtures.path('rc/non-readable/node.config.json'), constants.O_RDONLY); | |
| 366 | 369 | const result = await spawnPromisified(process.execPath, [ | |
| 367 | 370 | '--no-warnings', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - import { skipIfSQLiteMissing } from '../common/index.mjs'; | ||
| 1 | + import { isWindows, skipIfSQLiteMissing } from '../common/index.mjs'; | ||
| 2 | 2 | import tmpdir from '../common/tmpdir.js'; | |
| 3 | 3 | import { join } from 'node:path'; | |
| 4 | 4 | import { describe, test } from 'node:test'; | |
@@ -7,6 +7,8 @@ import { pathToFileURL } from 'node:url'; | |||
| 7 | 7 | skipIfSQLiteMissing(); | |
| 8 | 8 | const { backup, DatabaseSync } = await import('node:sqlite'); | |
| 9 | 9 | ||
| 10 | + const isRoot = !isWindows && process.getuid() === 0; | ||
| 11 | + | ||
| 10 | 12 | let cnt = 0; | |
| 11 | 13 | ||
| 12 | 14 | tmpdir.refresh(); | |
@@ -252,7 +254,7 @@ test('throws if URL is not file: scheme', (t) => { | |||
| 252 | 254 | }); | |
| 253 | 255 | }); | |
| 254 | 256 | ||
| 255 | - test('database backup fails when dest file is not writable', async (t) => { | ||
| 257 | + test('database backup fails when dest file is not writable', { skip: isRoot }, async (t) => { | ||
| 256 | 258 | const readonlyDestDb = nextDb(); | |
| 257 | 259 | writeFileSync(readonlyDestDb, '', { mode: 0o444 }); | |
| 258 | 260 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments