Update webpack, components for eslint. Adjust effected settings and code.

This commit is contained in:
NI
2021-07-09 17:28:47 +08:00
parent 52b33cc793
commit d66053a0dc
15 changed files with 412 additions and 704 deletions

View File

@@ -63,11 +63,11 @@ describe("Common", () => {
ee = e;
}
assert.notEqual(ee, null, "Test " + tests[i].sample);
assert.notStrictEqual(ee, null, "Test " + tests[i].sample);
} else {
let data = common.parseIPv4(tests[i].sample);
assert.deepEqual(data, tests[i].expected);
assert.deepStrictEqual(data, tests[i].expected);
}
}
});
@@ -78,28 +78,14 @@ describe("Common", () => {
sample: "2001:db8:1f70:0:999:de8:7648:6e8",
expectingFailure: false,
expected: new Uint16Array([
0x2001,
0xdb8,
0x1f70,
0x0,
0x999,
0xde8,
0x7648,
0x6e8,
0x2001, 0xdb8, 0x1f70, 0x0, 0x999, 0xde8, 0x7648, 0x6e8,
]),
},
{
sample: "2001:db8:85a3::8a2e:370:7334",
expectingFailure: false,
expected: new Uint16Array([
0x2001,
0xdb8,
0x85a3,
0x0,
0x0,
0x8a2e,
0x370,
0x7334,
0x2001, 0xdb8, 0x85a3, 0x0, 0x0, 0x8a2e, 0x370, 0x7334,
]),
},
{
@@ -116,42 +102,21 @@ describe("Common", () => {
sample: "2001:db8:1f70::999:de8:7648:6e8",
expectingFailure: false,
expected: new Uint16Array([
0x2001,
0xdb8,
0x1f70,
0x0,
0x999,
0xde8,
0x7648,
0x6e8,
0x2001, 0xdb8, 0x1f70, 0x0, 0x999, 0xde8, 0x7648, 0x6e8,
]),
},
{
sample: "2001:0db8:ac10:fe01::",
expectingFailure: false,
expected: new Uint16Array([
0x2001,
0x0db8,
0xac10,
0xfe01,
0x0,
0x0,
0x0,
0x0,
0x2001, 0x0db8, 0xac10, 0xfe01, 0x0, 0x0, 0x0, 0x0,
]),
},
{
sample: "::7f00:1",
expectingFailure: false,
expected: new Uint16Array([
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x7f00,
0x0001,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7f00, 0x0001,
]),
},
{
@@ -191,11 +156,11 @@ describe("Common", () => {
ee = e;
}
assert.notEqual(ee, null, "Test " + tests[i].sample);
assert.notStrictEqual(ee, null, "Test " + tests[i].sample);
} else {
let data = common.parseIPv6(tests[i].sample);
assert.deepEqual(data, tests[i].expected);
assert.deepStrictEqual(data, tests[i].expected);
}
}
});
@@ -236,14 +201,7 @@ describe("Common", () => {
expectedType: "IPv6",
expectedAddr: new Uint8Array(
new Uint16Array([
0x2001,
0xdb8,
0x1f70,
0x0,
0x999,
0xde8,
0x7648,
0x6e8,
0x2001, 0xdb8, 0x1f70, 0x0, 0x999, 0xde8, 0x7648, 0x6e8,
]).buffer
),
expectedPort: 22,
@@ -253,14 +211,7 @@ describe("Common", () => {
expectedType: "IPv6",
expectedAddr: new Uint8Array(
new Uint16Array([
0x2001,
0xdb8,
0x1f70,
0x0,
0x999,
0xde8,
0x7648,
0x6e8,
0x2001, 0xdb8, 0x1f70, 0x0, 0x999, 0xde8, 0x7648, 0x6e8,
]).buffer
),
expectedPort: 100,
@@ -270,9 +221,9 @@ describe("Common", () => {
for (let i in tests) {
let hostport = common.splitHostPort(tests[i].sample, 22);
assert.deepEqual(hostport.type, tests[i].expectedType);
assert.deepEqual(hostport.addr, tests[i].expectedAddr);
assert.equal(hostport.port, tests[i].expectedPort);
assert.deepStrictEqual(hostport.type, tests[i].expectedType);
assert.deepStrictEqual(hostport.addr, tests[i].expectedAddr);
assert.strictEqual(hostport.port, tests[i].expectedPort);
}
});
});