mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 15:43:13 +09:00
Move basicType to lib/helpers
Move the basicType function from the config lib to a shared helpers lib.
This commit is contained in:
1 parent
f05100c94d
commit
65494a0a91
3 files changed
+42
-15
No files matched your search
@@ -0,0 +1,17 @@
|
||||
const assert = require("assert").strict;
|
||||
|
||||
const helpers = require("lib/helpers");
|
||||
|
||||
|
||||
describe("lib/helpers", function() {
|
||||
describe("basicType()", function() {
|
||||
it("should return the expected values", function() {
|
||||
assert.equal(helpers.basicType("s"), "string");
|
||||
assert.equal(helpers.basicType(null), "null");
|
||||
assert.equal(helpers.basicType(undefined), "undefined");
|
||||
assert.equal(helpers.basicType([1, 2]), "array");
|
||||
assert.equal(helpers.basicType(7), "number");
|
||||
assert.equal(helpers.basicType({ a: 1 }), "object");
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user