Skip to content

Commit b719d2a

Browse files
author
Joe Previte
committed
fixup!: use utimes directly instead of file open
1 parent e203cc3 commit b719d2a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/unit/node/heart.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { logger } from "@coder/logger"
2-
import { readFile, writeFile, stat, open } from "fs/promises"
2+
import { readFile, writeFile, stat, open, utimes } from "fs/promises"
33
import { Heart, heartbeatTimer } from "../../../src/node/heart"
44
import { clean, mockLogger, tmpdir } from "../../utils/helpers"
55

@@ -36,8 +36,8 @@ describe("Heart", () => {
3636
// Explicitly set the modified time to 0 so that we can check
3737
// that the file was indeed modified after calling heart.beat().
3838
// This works around any potential race conditions.
39-
const fileHandle = await open(pathToFile, "r+")
40-
await fileHandle.utimes(0, 0)
39+
// Docs: https://nodejs.org/api/fs.html#fspromisesutimespath-atime-mtime
40+
await utimes(pathToFile, 0, 0)
4141

4242
expect(fileContents).toBe(text)
4343

0 commit comments

Comments
 (0)