Skip to content

Commit

Permalink
Node: fix lints (valkey-io#2062)
Browse files Browse the repository at this point in the history
* Fix linting on Node.js

---------

Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand authored Jul 31, 2024
1 parent a1c4af4 commit 1241dfe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- node/**
- benchmarks/utilities/*
- .github/workflows/lint-ts.yml
workflow_dispatch:

concurrency:
group: node-lint-${{ github.head_ref || github.ref }}
Expand Down
1 change: 1 addition & 0 deletions node/npm/glide/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { arch, platform } from "process";

let globalObject = global as unknown;

/* eslint-disable @typescript-eslint/no-require-imports */
function loadNativeBinding() {
let nativeBinding = null;
switch (platform) {
Expand Down
2 changes: 1 addition & 1 deletion node/tests/AsyncClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AsyncClient } from "glide-rs";
import RedisServer from "redis-server";
import { runCommonTests } from "./SharedTests";
import { flushallOnPort } from "./TestUtilities";
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-require-imports */
const FreePort = require("find-free-port");

const PORT_NUMBER = 4000;
Expand Down
14 changes: 8 additions & 6 deletions node/tests/SharedTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5647,10 +5647,12 @@ export function runBaseTests<Context>(config: {
await client.zmpop([key2, key1], ScoreFilter.MAX, 10),
).toEqual([key2, { a2: 0.1, b2: 0.2 }]);

expect(await client.zmpop([nonExistingKey], ScoreFilter.MIN))
.toBeNull;
expect(await client.zmpop([nonExistingKey], ScoreFilter.MIN, 1))
.toBeNull;
expect(
await client.zmpop([nonExistingKey], ScoreFilter.MIN),
).toBeNull();
expect(
await client.zmpop([nonExistingKey], ScoreFilter.MIN, 1),
).toBeNull();

// key exists, but it is not a sorted set
expect(await client.set(stringKey, "value")).toEqual("OK");
Expand Down Expand Up @@ -5748,15 +5750,15 @@ export function runBaseTests<Context>(config: {
// ensure that command doesn't time out even if timeout > request timeout (250ms by default)
expect(
await client.bzmpop([nonExistingKey], ScoreFilter.MAX, 0.5),
).toBeNull;
).toBeNull();
expect(
await client.bzmpop(
[nonExistingKey],
ScoreFilter.MAX,
0.55,
1,
),
).toBeNull;
).toBeNull();

// key exists, but it is not a sorted set
expect(await client.set(stringKey, "value")).toEqual("OK");
Expand Down
2 changes: 1 addition & 1 deletion node/tests/TestUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ export function validateTransactionResponse(

try {
expect(response?.[i]).toEqual(expectedResponse);
} catch (e) {
} catch {
const expected =
expectedResponse instanceof Map
? JSON.stringify(Array.from(expectedResponse.entries()))
Expand Down

0 comments on commit 1241dfe

Please sign in to comment.