2022-02-04 14:12:00 +11:00
|
|
|
import { expect } from "chai";
|
2021-03-22 16:02:10 +11:00
|
|
|
|
2022-05-26 15:50:51 +10:00
|
|
|
import { argsToArray, defaultArgs } from "./nwaku";
|
2021-03-11 10:54:35 +11:00
|
|
|
|
2022-04-01 12:19:51 +11:00
|
|
|
describe("nwaku", () => {
|
2022-02-04 14:12:00 +11:00
|
|
|
it("Correctly serialized arguments", function () {
|
2022-01-24 11:00:41 +11:00
|
|
|
const args = defaultArgs();
|
|
|
|
|
Object.assign(args, { portsShift: 42 });
|
|
|
|
|
|
|
|
|
|
const actual = argsToArray(args);
|
|
|
|
|
|
|
|
|
|
const expected = [
|
2022-02-04 14:12:00 +11:00
|
|
|
"--listen-address=127.0.0.1",
|
2022-05-26 15:49:39 +10:00
|
|
|
"--nat=none",
|
2022-02-04 14:12:00 +11:00
|
|
|
"--relay=true",
|
|
|
|
|
"--rpc=true",
|
|
|
|
|
"--rpc-admin=true",
|
|
|
|
|
"--websocket-support=true",
|
2022-08-20 12:34:36 +10:00
|
|
|
"--log-level=DEBUG",
|
2022-02-04 14:12:00 +11:00
|
|
|
"--ports-shift=42",
|
2022-01-24 11:00:41 +11:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
expect(actual).to.deep.equal(expected);
|
|
|
|
|
});
|
2021-03-12 10:44:47 +11:00
|
|
|
});
|