From bb4b1fd21b8b5c8cd9fd8d660ca688a53734cbd5 Mon Sep 17 00:00:00 2001 From: Carlos Espa Date: Sat, 29 Jul 2023 11:00:01 +0200 Subject: [PATCH] change test from file --- test/parallel/test-cli-permission-deny-fs.js | 24 ------------------- .../test-cli-permission-fs-path-delimiter.js | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/parallel/test-cli-permission-deny-fs.js b/test/parallel/test-cli-permission-deny-fs.js index 2544213cfff192..964a0ad0a0e0c2 100644 --- a/test/parallel/test-cli-permission-deny-fs.js +++ b/test/parallel/test-cli-permission-deny-fs.js @@ -47,30 +47,6 @@ const path = require('path'); assert.strictEqual(status, 0); } -{ - const tmpPath = path.resolve('/tmp/'); - const otherPath = path.resolve('/other-path/'); - const { status, stdout } = spawnSync( - process.execPath, - [ - '--experimental-permission', - '--allow-fs-write', `${tmpPath},${otherPath}`, '-e', - `console.log(process.permission.has("fs")); - console.log(process.permission.has("fs.read")); - console.log(process.permission.has("fs.write")); - console.log(process.permission.has("fs.write", "/tmp/")); - console.log(process.permission.has("fs.write", "/other-path/"));`, - ] - ); - const [fs, fsIn, fsOut, fsOutAllowed1, fsOutAllowed2] = stdout.toString().split('\n'); - assert.strictEqual(fs, 'false'); - assert.strictEqual(fsIn, 'false'); - assert.strictEqual(fsOut, 'false'); - assert.strictEqual(fsOutAllowed1, 'true'); - assert.strictEqual(fsOutAllowed2, 'true'); - assert.strictEqual(status, 0); -} - { const { status, stdout } = spawnSync( process.execPath, diff --git a/test/parallel/test-cli-permission-fs-path-delimiter.js b/test/parallel/test-cli-permission-fs-path-delimiter.js index 6d726e1a7fb2ee..704a057788062a 100644 --- a/test/parallel/test-cli-permission-fs-path-delimiter.js +++ b/test/parallel/test-cli-permission-fs-path-delimiter.js @@ -4,6 +4,30 @@ const { spawnSync } = require('child_process'); const assert = require('assert'); const path = require('path'); +{ + const tmpPath = path.resolve('/tmp/'); + const otherPath = path.resolve('/other-path/'); + const { status, stdout } = spawnSync( + process.execPath, + [ + '--experimental-permission', + '--allow-fs-write', `${tmpPath},${otherPath}`, '-e', + `console.log(process.permission.has("fs")); + console.log(process.permission.has("fs.read")); + console.log(process.permission.has("fs.write")); + console.log(process.permission.has("fs.write", "/tmp/")); + console.log(process.permission.has("fs.write", "/other-path/"));`, + ] + ); + const [fs, fsIn, fsOut, fsOutAllowed1, fsOutAllowed2] = stdout.toString().split('\n'); + assert.strictEqual(fs, 'false'); + assert.strictEqual(fsIn, 'false'); + assert.strictEqual(fsOut, 'false'); + assert.strictEqual(fsOutAllowed1, 'true'); + assert.strictEqual(fsOutAllowed2, 'true'); + assert.strictEqual(status, 0); +} + { const tmpPath = path.resolve('/tmp/'); const pathWithComma = path.resolve('/other,path/');