Files
start-sdk/lib/config/builder/index.test.ts
2023-03-29 08:52:51 -06:00

49 lines
1.2 KiB
TypeScript

describe("test", () => {
test("test", () => {
expect(true).toEqual(true);
});
});
import { Config } from "./config";
import { Value } from "./value";
describe("builder tests", () => {
test("String", () => {
const bitcoinPropertiesBuilt: {
"peer-tor-address": {
name: string;
description: string | null;
type: "string";
};
} = Config.of({
"peer-tor-address": Value.string({
name: "Peer tor address",
default: "",
description: "The Tor address of the peer interface",
warning: null,
nullable: false,
masked: true,
placeholder: null,
pattern: null,
patternDescription: null,
}),
}).build();
expect(JSON.stringify(bitcoinPropertiesBuilt)).toEqual(
/*json*/ `{
"peer-tor-address": {
"type": "string",
"name": "Peer tor address",
"default": "",
"description": "The Tor address of the peer interface",
"warning": null,
"nullable": false,
"masked": true,
"placeholder": null,
"pattern": null,
"patternDescription": null
}}`
.replaceAll("\n", " ")
.replaceAll(/\s{2,}/g, "")
.replaceAll(": ", ":")
);
});
});