Skip to content

Commit

Permalink
test,doc: apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Apr 23, 2023
1 parent a415001 commit 3d386a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5069,6 +5069,9 @@ added:
- v19.2.0
- v18.13.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/47613
description: Makes File instances cloneable.
- version: v20.0.0
pr-url: https://github.com/nodejs/node/pull/47153
description: No longer experimental.
Expand Down
12 changes: 9 additions & 3 deletions test/parallel/test-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@ const { inspect } = require('util');
const file = new File(body, name, { lastModified });
const clonedFile = structuredClone(file);

assert.deepStrictEqual(await file.text(), await clonedFile.text());
assert.deepStrictEqual(file.lastModified, clonedFile.lastModified);
assert.deepStrictEqual(file.name, clonedFile.name);
assert.deepStrictEqual(await clonedFile.text(), await file.text());
assert.deepStrictEqual(clonedFile.lastModified, file.lastModified);
assert.deepStrictEqual(clonedFile.name, file.name);

const clonedFile2 = structuredClone(clonedFile);

assert.deepStrictEqual(await clonedFile2.text(), await clonedFile.text());
assert.deepStrictEqual(clonedFile2.lastModified, clonedFile.lastModified);
assert.deepStrictEqual(clonedFile2.name, clonedFile.name);
})().then(common.mustCall());

0 comments on commit 3d386a5

Please sign in to comment.