Skip to content

Commit

Permalink
fix some tests for nodev20. see tschaub/mock-fs#377
Browse files Browse the repository at this point in the history
  • Loading branch information
RythenGlyth committed Oct 16, 2023
1 parent 75d56a6 commit acdd0aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/fileTransferSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ describe("Download to a file", function() {

it("can download to a new, not yet existing file", async () => {
await this.client.downloadTo(NEW_LOCAL_FILENAME, REMOTE_FILENAME)
const content = fs.readFileSync(NEW_LOCAL_FILENAME, "utf-8")
const content = fs.readFileSync(NEW_LOCAL_FILENAME).toString("utf-8")
assert.equal(content, SHORT_TEXT)
})

it("truncates existing file with startAt=0", async () => {
await this.client.downloadTo(EXISTING_LOCAL_FILENAME, REMOTE_FILENAME)
const content = fs.readFileSync(EXISTING_LOCAL_FILENAME, "utf-8")
const content = fs.readFileSync(EXISTING_LOCAL_FILENAME).toString("utf-8")
assert.equal(content, SHORT_TEXT)
})

it("appends to existing file with start>0", async () => {
const startAt = 4
await this.client.downloadTo(EXISTING_LOCAL_FILENAME, REMOTE_FILENAME, startAt)
const content = fs.readFileSync(EXISTING_LOCAL_FILENAME, "utf-8")
const content = fs.readFileSync(EXISTING_LOCAL_FILENAME).toString("utf-8")
assert.equal(content, "cont" + SHORT_TEXT.substring(startAt))
})

Expand Down

0 comments on commit acdd0aa

Please sign in to comment.