Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/parallel/test-config-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const { test, it, describe } = require('node:test');
const { chmodSync, constants } = require('node:fs');
const common = require('../common');

const isRoot = process.getuid() === 0;

test('should handle non existing json', async () => {
const result = await spawnPromisified(process.execPath, [
'--experimental-config-file',
Expand Down Expand Up @@ -361,7 +363,7 @@ test('should override node.config.json when specificied', async () => {
strictEqual(result.code, 0);
});
// Skip on windows because it doesn't support chmod changing read permissions
test('should throw an error when the file is non readable', { skip: common.isWindows }, async () => {
test('should throw an error when the file is non readable', { skip: common.isWindows || isRoot }, async () => {
chmodSync(fixtures.path('rc/non-readable/node.config.json'), constants.O_RDONLY);
const result = await spawnPromisified(process.execPath, [
'--no-warnings',
Expand Down
6 changes: 4 additions & 2 deletions test/parallel/test-sqlite-backup.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { skipIfSQLiteMissing } from '../common/index.mjs';
import { isWindows, skipIfSQLiteMissing } from '../common/index.mjs';
import tmpdir from '../common/tmpdir.js';
import { join } from 'node:path';
import { describe, test } from 'node:test';
Expand All @@ -7,6 +7,8 @@ import { pathToFileURL } from 'node:url';
skipIfSQLiteMissing();
const { backup, DatabaseSync } = await import('node:sqlite');

const isRoot = !isWindows && process.getuid() === 0;

let cnt = 0;

tmpdir.refresh();
Expand Down Expand Up @@ -252,7 +254,7 @@ test('throws if URL is not file: scheme', (t) => {
});
});

test('database backup fails when dest file is not writable', async (t) => {
test('database backup fails when dest file is not writable', { skip: isRoot }, async (t) => {
const readonlyDestDb = nextDb();
writeFileSync(readonlyDestDb, '', { mode: 0o444 });

Expand Down
Loading