mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Prefix clusterio/lib imports with lib
Use lib* prefix for the modules impored from the lib package to help distinguish them more from ordinary variables. Fix up the naming convention for files to be consistently lowercase_underscore for JavaScript files.
This commit is contained in:
1 parent
fbbaf3dd3a
commit
24397b75cc
55 files changed
+692
-668
No files matched your search
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
const assert = require("assert");
|
||||
const fs = require("fs-extra");
|
||||
const path = require("path");
|
||||
|
||||
const generateSslCert = require("@clusterio/master/src/generate_ssl_cert");
|
||||
|
||||
describe("generate_ssl_cert", function() {
|
||||
let testDir = path.join("temp", "test", "certTest");
|
||||
before(async function() {
|
||||
await fs.remove(testDir);
|
||||
});
|
||||
|
||||
it("Creates a folder with a .crt and .key file in it", async function() {
|
||||
this.timeout(1000);
|
||||
// eslint-disable-next-line no-process-env
|
||||
if (process.env.FAST_TEST) {
|
||||
this.skip();
|
||||
}
|
||||
|
||||
let certPath = path.join(testDir, "cert.crt");
|
||||
let privKeyPath = path.join(testDir, "cert.key");
|
||||
|
||||
await generateSslCert({
|
||||
bits: 512, // This is too small for real world usage, but faster to test
|
||||
sslCertPath: certPath,
|
||||
sslPrivKeyPath: privKeyPath,
|
||||
doLogging: false,
|
||||
});
|
||||
|
||||
assert(await fs.exists(certPath), "cert file was not created");
|
||||
assert(await fs.exists(privKeyPath), "key file was not created");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user