Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: new filter tests #1552

Merged
merged 10 commits into from
Sep 12, 2023
9 changes: 7 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
"webfonts",
"websockets",
"wifi",
"xsalsa20"
"xsalsa20",
"Привет",
"مرحبا"
],
"flagWords": [],
"ignorePaths": [
Expand All @@ -142,5 +144,8 @@
"pattern": "//dns4/.*/"
}
],
"ignoreRegExpList": ["import", "multiaddr"]
"ignoreRegExpList": [
"import",
"multiaddr"
]
}
36 changes: 36 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"chai-as-promised": "^7.1.1",
"debug": "^4.3.4",
"dockerode": "^3.3.5",
"p-retry": "^6.0.0",
"p-timeout": "^6.1.0",
"portfinder": "^1.0.32",
"sinon": "^15.2.0",
Expand Down
26 changes: 26 additions & 0 deletions packages/tests/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,29 @@ export const NOISE_KEY_3 = new Uint8Array(
return b;
})()
);

export const TEST_STRING = [
{ description: "short", value: "hi" },
{ description: "long", value: "A".repeat(10000) },
{ description: "numeric", value: "1234567890" },
{ description: "special chars", value: "!@#$%^&*()_+" },
{ description: "Chinese", value: "你好" },
{ description: "Arabic", value: "مرحبا" },
{ description: "Russian", value: "Привет" },
{ description: "SQL Injection", value: "'; DROP TABLE users; --" },
{ description: "Script", value: '<script>alert("hacked");</script>' },
{ description: "XML", value: "<element>Some content</element>" },
{ description: "Basic HTML tag", value: "<h1>Heading</h1>" },
{ description: "JSON", value: '{"user":"admin","password":"123456"}' },
{ description: "shell command", value: "`rm -rf /`" },
{ description: "escaped characters", value: "\\n\\t\\0" },
{ description: "unicode special characters", value: "\u202Ereverse" }
];

export const TEST_TIMESTAMPS = [
BigInt(Date.now()) * BigInt(1000000),
Date.now(),
1649153314,
1949153314000,
undefined
];
2 changes: 1 addition & 1 deletion packages/tests/src/node/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ export class NimGoNode {
return `http://127.0.0.1:${this.rpcPort}/`;
}

private async rpcCall<T>(
async rpcCall<T>(
method: string,
params: Array<string | number | unknown>
): Promise<T> {
Expand Down
213 changes: 0 additions & 213 deletions packages/tests/tests/filter.node.spec.ts

This file was deleted.

Loading
Loading