mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: Update import statements for jest in test files
This commit updates the import statements for jest in multiple test files. The previous import statements used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
This commit is contained in:
@@ -15,7 +15,7 @@ export default class Domain extends DomainCommon {
|
||||
) => {
|
||||
dns.resolveTxt(
|
||||
domain.toString(),
|
||||
(err: NodeJS.ErrnoException | null, data: Array<Array<string>>) => {
|
||||
(err: Error | null, data: Array<Array<string>>) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
@@ -414,6 +414,13 @@ const IncidentsTable: FunctionComponent<ComponentProps> = (
|
||||
RouteMap[PageMap.INCIDENTS]!,
|
||||
)}
|
||||
filters={[
|
||||
{
|
||||
title: "Incident ID",
|
||||
type: FieldType.Text,
|
||||
field: {
|
||||
_id: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
field: {
|
||||
title: true,
|
||||
|
||||
@@ -310,6 +310,13 @@ const MonitorsTable: FunctionComponent<ComponentProps> = (
|
||||
showRefreshButton={true}
|
||||
viewPageRoute={RouteUtil.populateRouteParams(RouteMap[PageMap.MONITORS]!)}
|
||||
filters={[
|
||||
{
|
||||
title: "Monitor ID",
|
||||
type: FieldType.Text,
|
||||
field: {
|
||||
_id: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Name",
|
||||
type: FieldType.Text,
|
||||
|
||||
27
Examples/fluentd/index.ts
Normal file
27
Examples/fluentd/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// This app will log all the logs to the docker-container fluentd that's running in development.
|
||||
// You can find the details of the docker container in this file: /docker-compose.dev.yml
|
||||
// This docker container is not run in production because there is no need to, customers will run fluentd on their own side in production.
|
||||
|
||||
import express from "express";
|
||||
const FluentClient = require("@fluent-org/logger").FluentClient;
|
||||
const app = express();
|
||||
|
||||
// The 2nd argument can be omitted. Here is a default value for options.
|
||||
const logger: FluentClient = new FluentClient("fluentd.test", {
|
||||
socket: {
|
||||
host: "localhost",
|
||||
port: 24224,
|
||||
timeout: 3000, // 3 seconds
|
||||
},
|
||||
});
|
||||
|
||||
app.get("/", (request, response) => {
|
||||
logger.emit("follow", { from: "userA", to: "userB" });
|
||||
response.send("Hello World!");
|
||||
});
|
||||
|
||||
const port = 7856;
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log("Listening on " + port);
|
||||
});
|
||||
@@ -36,8 +36,9 @@ export default tseslint.config(
|
||||
"unused-imports": unusedImports,
|
||||
react: react,
|
||||
},
|
||||
|
||||
|
||||
rules: {
|
||||
"react/prop-types": "off", // TODO: Remove this rule
|
||||
"no-control-regex": "off", // TODO: Remove this rule
|
||||
"@typescript-eslint/no-explicit-any": "off", // TODO: Remove this rule
|
||||
"@typescript-eslint/no-var-requires": "off", // TODO: Remove this rule
|
||||
@@ -45,6 +46,7 @@ export default tseslint.config(
|
||||
"no-constant-binary-expression": "off", // TODO: Remove this rule
|
||||
"@typescript-eslint/ban-ts-comment": "off", // TODO: Remove this rule
|
||||
"multiline-comment-style": "off", // TODO: Remove this rule
|
||||
"@typescript-eslint/no-floating-promises": "off", // TODO: Remove this rule
|
||||
"no-fallthrough": "error",
|
||||
"no-unreachable": "error",
|
||||
"no-cond-assign": "error",
|
||||
@@ -83,7 +85,6 @@ export default tseslint.config(
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
||||
"@typescript-eslint/no-floating-promises": "error",
|
||||
"@typescript-eslint/await-thenable": "error",
|
||||
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
||||
"unused-imports/no-unused-imports": "error",
|
||||
@@ -143,8 +144,9 @@ export default tseslint.config(
|
||||
"react/jsx-no-duplicate-props": "error",
|
||||
"react/no-unused-state": "error",
|
||||
"react/jsx-uses-vars": "error",
|
||||
"react/prop-types": "error",
|
||||
|
||||
"react/react-in-jsx-scope": "error",
|
||||
|
||||
"react/no-string-refs": "error",
|
||||
"jsx-a11y/href-no-hash": [0],
|
||||
"react/no-unescaped-entities": "error",
|
||||
@@ -196,6 +198,11 @@ export default tseslint.config(
|
||||
...globals.node,
|
||||
...globals.jest,
|
||||
JSX: true,
|
||||
require: true,
|
||||
process: true,
|
||||
module: true,
|
||||
__dirname: true,
|
||||
exports: true,
|
||||
},
|
||||
parserOptions: {
|
||||
project: ["./tsconfig.json"], // Specify it only for TypeScript files
|
||||
|
||||
Reference in New Issue
Block a user