2022-02-04 14:12:00 +11:00
|
|
|
import { expect } from "chai";
|
2021-03-22 16:02:10 +11:00
|
|
|
|
2022-12-02 15:43:46 +11:00
|
|
|
import { argsToArray, defaultArgs } from "../src/index.js";
|
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",
|
|
|
|
|
"--rpc=true",
|
2022-12-12 11:08:08 +05:30
|
|
|
"--relay=false",
|
2022-02-04 14:12:00 +11:00
|
|
|
"--rpc-admin=true",
|
|
|
|
|
"--websocket-support=true",
|
2022-11-17 11:02:04 +11:00
|
|
|
"--log-level=TRACE",
|
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
|
|
|
});
|