Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 61cd11a

Browse filesBrowse files
LiviaMedeirosdanielleadams
authored andcommitted
test: use common.mustNotMutateObjectDeep() in fs tests
PR-URL: #43819 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 7762e46 commit 61cd11a
Copy full SHA for 61cd11a
Expand file treeCollapse file tree

19 files changed

+216
-190
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-fs-access.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-access.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ assert.throws(
145145

146146
assert.throws(
147147
() => {
148-
fs.access(__filename, fs.F_OK, {});
148+
fs.access(__filename, fs.F_OK, common.mustNotMutateObjectDeep({}));
149149
},
150150
{
151151
code: 'ERR_INVALID_ARG_TYPE',
Collapse file

‎test/parallel/test-fs-append-file-sync.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-append-file-sync.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ const fileData3 = fs.readFileSync(filename3);
7171
assert.strictEqual(buf.length + currentFileData.length, fileData3.length);
7272

7373
const filename4 = join(tmpdir.path, 'append-sync4.txt');
74-
fs.writeFileSync(filename4, currentFileData, { mode: m });
74+
fs.writeFileSync(filename4, currentFileData, common.mustNotMutateObjectDeep({ mode: m }));
7575

7676
[
7777
true, false, 0, 1, Infinity, () => {}, {}, [], undefined, null,
7878
].forEach((value) => {
7979
assert.throws(
80-
() => fs.appendFileSync(filename4, value, { mode: m }),
80+
() => fs.appendFileSync(filename4, value, common.mustNotMutateObjectDeep({ mode: m })),
8181
{ message: /data/, code: 'ERR_INVALID_ARG_TYPE' }
8282
);
8383
});
84-
fs.appendFileSync(filename4, `${num}`, { mode: m });
84+
fs.appendFileSync(filename4, `${num}`, common.mustNotMutateObjectDeep({ mode: m }));
8585

8686
// Windows permissions aren't Unix.
8787
if (!common.isWindows) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.