Task: Add write file from string and tests

This commit is contained in:
2022-02-15 11:57:23 +07:00
parent 27f9320bda
commit 8453af2efa
3 changed files with 27 additions and 0 deletions

11
test/file.test.ts Normal file
View File

@@ -0,0 +1,11 @@
import { randomUUID } from "crypto"
import { writeFileFromString } from "../src/util/file.util"
test("Write File from String", () => {
const filePath = "./ignore/test.json"
const fileContent = {
key: randomUUID(),
iv: randomUUID(),
}
writeFileFromString(filePath, JSON.stringify(fileContent))
})