Move basicType to lib/helpers

Move the basicType function from the config lib to a shared helpers lib.
This commit is contained in:
Hornwitser committed 2020-04-03 20:51:28 +02:00
1 parent f05100c94d
commit 65494a0a91
3 files changed
+42 -15

No files matched your search

+17
View File
@@ -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");
});
});
});