Archived
1
0

feat: cli arg for file permission of socket (#4923)

This commit is contained in:
Ciel
2022-03-04 00:54:35 +08:00
committed by GitHub
parent 78658f1cf4
commit c4d87580ef
4 changed files with 34 additions and 4 deletions

View File

@ -107,6 +107,18 @@ describe("createApp", () => {
app.dispose()
})
it("should change the file mode of a socket", async () => {
const defaultArgs = await setDefaults({
socket: tmpFilePath,
"socket-mode": "777",
})
const app = await createApp(defaultArgs)
expect((await promises.stat(tmpFilePath)).mode & 0o777).toBe(0o777)
app.dispose()
})
it("should create an https server if args.cert exists", async () => {
const testCertificate = await generateCertificate("localhost")
const cert = new OptionalString(testCertificate.cert)