Skip to content

Commit

Permalink
Bump prettier from 2.8.8 to 3.0.3 (#242)
Browse files Browse the repository at this point in the history
* Bump prettier from 2.8.8 to 3.0.3

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.8.8...3.0.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* foramt

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: evantahler <evan@airbyte.io>
  • Loading branch information
dependabot[bot] and evantahler authored Sep 1, 2023
1 parent af399ca commit 0ceb7f1
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 52 deletions.
45 changes: 24 additions & 21 deletions __tests__/servers/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let client2Details = { id: null };
const makeSocketRequest = async (
thisClient,
message = "",
delimiter = "\r\n"
delimiter = "\r\n",
): Promise<any> => {
let data = "";
let response;
Expand Down Expand Up @@ -97,18 +97,18 @@ describe("Server: Socket", () => {
const response = await makeSocketRequest(client, "status");
expect(response).toBeInstanceOf(Object);
expect(response.id).toEqual(
`test-server-${process.env.JEST_WORKER_ID || 0}`
`test-server-${process.env.JEST_WORKER_ID || 0}`,
);
});

test("stringified JSON can also be sent as actions", async () => {
const response = await makeSocketRequest(
client,
JSON.stringify({ action: "status", params: { something: "else" } })
JSON.stringify({ action: "status", params: { something: "else" } }),
);
expect(response).toBeInstanceOf(Object);
expect(response.id).toEqual(
`test-server-${process.env.JEST_WORKER_ID || 0}`
`test-server-${process.env.JEST_WORKER_ID || 0}`,
);
});

Expand All @@ -133,7 +133,7 @@ describe("Server: Socket", () => {

const response = await makeSocketRequest(client, JSON.stringify(msg));
expect(response.cacheTestResults.loadResp.key).toEqual(
"cacheTest_" + msg.params.key
"cacheTest_" + msg.params.key,
);
expect(response.cacheTestResults.loadResp.value).toEqual(msg.params.value);
});
Expand Down Expand Up @@ -167,14 +167,14 @@ describe("Server: Socket", () => {
await makeSocketRequest(client, "paramDelete key");
const response = await makeSocketRequest(client, "cacheTest");
expect(response.error).toEqual(
"key is a required parameter for this action"
"key is a required parameter for this action",
);
});

test("a new param can be added and viewed", async () => {
const response = await makeSocketRequest(
client,
"paramAdd key=socketTestKey"
"paramAdd key=socketTestKey",
);
expect(response.status).toEqual("OK");
const viewResponse = await makeSocketRequest(client, "paramView key");
Expand All @@ -201,24 +201,27 @@ describe("Server: Socket", () => {
const response = await makeSocketRequest(client, "cacheTest");
expect(response.error).toBeUndefined();
expect(response.cacheTestResults.loadResp.key).toEqual(
"cacheTest_socketTestKey"
"cacheTest_socketTestKey",
);
expect(response.cacheTestResults.loadResp.value).toEqual("abc123");

const responseAgain = await makeSocketRequest(client, "cacheTest");
expect(responseAgain.cacheTestResults.loadResp.key).toEqual(
"cacheTest_socketTestKey"
"cacheTest_socketTestKey",
);
expect(responseAgain.cacheTestResults.loadResp.value).toEqual("abc123");
});

test("only params sent in a JSON block are used", async () => {
const response = await makeSocketRequest(
client,
JSON.stringify({ action: "cacheTest", params: { key: "someOtherValue" } })
JSON.stringify({
action: "cacheTest",
params: { key: "someOtherValue" },
}),
);
expect(response.error).toEqual(
"value is a required parameter for this action"
"value is a required parameter for this action",
);
});

Expand All @@ -241,7 +244,7 @@ describe("Server: Socket", () => {
JSON.stringify({
action: "randomNumber",
params: { messageId: "abc123" },
})
}),
);
expect(response.messageId).toEqual("abc123");
});
Expand Down Expand Up @@ -294,7 +297,7 @@ describe("Server: Socket", () => {
const response = responses[i];
if (i === "0") {
expect(response.error).toEqual(
"you have too many pending requests"
"you have too many pending requests",
);
} else {
expect(response.error).toBeUndefined();
Expand Down Expand Up @@ -393,7 +396,7 @@ describe("Server: Socket", () => {
expect(response.status).toEqual("OK");
const responseAgain = await makeSocketRequest(
client,
"roomView otherRoom"
"roomView otherRoom",
);
expect(responseAgain.data.room).toEqual("otherRoom");
expect(responseAgain.data.membersCount).toEqual(1);
Expand Down Expand Up @@ -421,7 +424,7 @@ describe("Server: Socket", () => {
await api.chatRoom.broadcast(
{},
room,
`I have entered the room: ${connection.id}`
`I have entered the room: ${connection.id}`,
);
},
});
Expand All @@ -432,7 +435,7 @@ describe("Server: Socket", () => {
await api.chatRoom.broadcast(
{},
room,
`I have left the room: ${connection.id}`
`I have left the room: ${connection.id}`,
);
},
});
Expand All @@ -453,7 +456,7 @@ describe("Server: Socket", () => {
makeSocketRequest(client2, "roomAdd otherRoom");
const response = await makeSocketRequest(client, "");
expect(response.message).toEqual(
"I have entered the room: " + client2Details.id
"I have entered the room: " + client2Details.id,
);
expect(response.from.toString()).toEqual("0");
});
Expand All @@ -462,7 +465,7 @@ describe("Server: Socket", () => {
makeSocketRequest(client2, "roomLeave defaultRoom\r\n");
const response = await makeSocketRequest(client, "");
expect(response.message).toEqual(
"I have left the room: " + client2Details.id
"I have left the room: " + client2Details.id,
);
expect(response.from.toString()).toEqual("0");
});
Expand Down Expand Up @@ -496,7 +499,7 @@ describe("Server: Socket", () => {
await makeSocketRequest(client2, "roomAdd defaultRoom");
const response = await makeSocketRequest(
client2,
"roomView defaultRoom"
"roomView defaultRoom",
);
expect(response.data.room).toEqual("defaultRoom");
for (const key in response.data.members) {
Expand Down Expand Up @@ -546,7 +549,7 @@ describe("Server: Socket", () => {
await makeSocketRequest(client2, "roomAdd defaultRoom");
const response = await makeSocketRequest(
client2,
"roomView defaultRoom"
"roomView defaultRoom",
);
expect(response.data.room).toEqual("defaultRoom");
for (const key in response.data.members) {
Expand All @@ -565,7 +568,7 @@ describe("Server: Socket", () => {
test("server can disconnect a client", async () => {
const response = await makeSocketRequest(client, "status");
expect(response.id).toEqual(
`test-server-${process.env.JEST_WORKER_ID || 0}`
`test-server-${process.env.JEST_WORKER_ID || 0}`,
);
expect(client.readable).toEqual(true);
expect(client.writable).toEqual(true);
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/node": "^20.2.5",
"actionhero": "^29.0.0",
"jest": "^27.1.0",
"prettier": "^2.3.2",
"prettier": "^3.0.3",
"ts-jest": "^27.0.5",
"ts-node-dev": "^2.0.0",
"typescript": "^4.4.2"
Expand Down
4 changes: 2 additions & 2 deletions src/actions/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ enum StatusMessages {
const packageJSON = JSON.parse(
fs
.readFileSync(
path.normalize(path.join(__dirname, "..", "..", "package.json"))
path.normalize(path.join(__dirname, "..", "..", "package.json")),
)
.toString()
.toString(),
);

export class Status extends Action {
Expand Down
2 changes: 1 addition & 1 deletion src/config/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const DEFAULT = {
const packageJSON: PackageJson = JSON.parse(
fs
.readFileSync(path.join(__dirname, "..", "..", "package.json"))
.toString()
.toString(),
);

return {
Expand Down
4 changes: 2 additions & 2 deletions src/config/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const DEFAULT = {
// When a params for an action is invalid
invalidParams: (
data: ActionProcessor<any>,
validationErrors: Array<string | Error>
validationErrors: Array<string | Error>,
) => {
if (validationErrors.length >= 0) return validationErrors[0];
return "validation error";
Expand Down Expand Up @@ -100,7 +100,7 @@ export const DEFAULT = {
// an error to the client. Response can be edited here, status codes changed, etc.
async genericError(
data: ActionProcessor<any>,
error: NodeJS.ErrnoException
error: NodeJS.ErrnoException,
) {
return error;
},
Expand Down
6 changes: 3 additions & 3 deletions src/config/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function buildConsoleLogger(level = "info") {
return `${info.timestamp} - ${info.level}: ${
info.message
} ${stringifyExtraMessagePropertiesForConsole(info)}`;
})
}),
),
level,
levels: winston.config.syslog.levels,
Expand All @@ -78,7 +78,7 @@ function buildFileLogger(path: string, level = "info", maxFiles?: number) {
return winston.createLogger({
format: winston.format.combine(
winston.format.timestamp(),
winston.format.json()
winston.format.json(),
),
level,
levels: winston.config.syslog.levels,
Expand All @@ -93,7 +93,7 @@ function buildFileLogger(path: string, level = "info", maxFiles?: number) {
}

function stringifyExtraMessagePropertiesForConsole(
info: winston.Logform.TransformableInfo
info: winston.Logform.TransformableInfo,
) {
const skippedProperties = ["message", "timestamp", "level"];
let response = "";
Expand Down
2 changes: 1 addition & 1 deletion src/config/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const DEFAULT = {
retryStrategy: (times: number) => {
if (times === 1) {
console.error(
"Unable to connect to Redis - please check your Redis config!"
"Unable to connect to Redis - please check your Redis config!",
);
return 5000;
}
Expand Down
Loading

0 comments on commit 0ceb7f1

Please sign in to comment.