Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
`serpapi-javascript` is developed using Deno. Refer to
https://deno.land/manual/getting_started/installation to install Deno.

Ensure you're running at least Deno v1.28.3.
Ensure you're running at least Deno v1.46.3.

```bash
deno --version
Expand Down
7 changes: 7 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
"test:cov": "rm -rf cov_profile && deno task test --coverage=cov_profile && deno coverage cov_profile",
"npm": "deno run -A scripts/build_npm.ts"
},
"imports": {
"@deno/dnt": "https://deno.land/x/dnt@0.40.0/mod.ts",
"@std/dotenv": "https://deno.land/std@0.173.0/dotenv/mod.ts",
"@std/testing/asserts": "https://deno.land/std@0.170.0/testing/asserts.ts",
"@std/testing/bdd": "https://deno.land/std@0.170.0/testing/bdd.ts",
"@std/testing/mock": "https://deno.land/std@0.170.0/testing/mock.ts"
},
"fmt": {
"exclude": ["npm/", "examples/node", "smoke_tests/"]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/basic_example.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loadSync } from "https://deno.land/std@0.173.0/dotenv/mod.ts";
import { loadSync } from "@std/dotenv";
import { config, getJson } from "../../mod.ts";

const { API_KEY: apiKey } = loadSync();
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/pagination_example.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loadSync } from "https://deno.land/std@0.173.0/dotenv/mod.ts";
import { loadSync } from "@std/dotenv";
import { config, getJson } from "../../mod.ts";

const { API_KEY: apiKey } = loadSync();
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_npm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { build, emptyDir } from "https://deno.land/x/dnt@0.40.0/mod.ts";
import { build, emptyDir } from "@deno/dnt";
import { version } from "../version.ts";

await emptyDir("./npm");
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function execute(
});

return new Promise((resolve, reject) => {
let timer: number;
let timer: ReturnType<typeof setTimeout>;

const handleResponse = (resp: http.IncomingMessage) => {
resp.setEncoding("utf8");
Expand Down
14 changes: 4 additions & 10 deletions tests/serpapi_test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { loadSync } from "https://deno.land/std@0.170.0/dotenv/mod.ts";
import {
afterAll,
afterEach,
beforeAll,
describe,
it,
} from "https://deno.land/std@0.170.0/testing/bdd.ts";
import { loadSync } from "@std/dotenv";
import { afterAll, afterEach, beforeAll, describe, it } from "@std/testing/bdd";
import {
assert,
assertArrayIncludes,
Expand All @@ -14,14 +8,14 @@ import {
assertInstanceOf,
assertRejects,
assertStringIncludes,
} from "https://deno.land/std@0.170.0/testing/asserts.ts";
} from "@std/testing/asserts";
import {
assertSpyCallArg,
assertSpyCalls,
spy,
Stub,
stub,
} from "https://deno.land/std@0.170.0/testing/mock.ts";
} from "@std/testing/mock";
import { _internals } from "../src/utils.ts";
import {
BaseResponse,
Expand Down
13 changes: 4 additions & 9 deletions tests/utils_test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import http from "node:http";
import qs from "node:querystring";
import { loadSync } from "https://deno.land/std@0.170.0/dotenv/mod.ts";
import {
afterAll,
beforeAll,
describe,
it,
} from "https://deno.land/std@0.170.0/testing/bdd.ts";
import { Stub, stub } from "https://deno.land/std@0.170.0/testing/mock.ts";
import { loadSync } from "@std/dotenv";
import { afterAll, beforeAll, describe, it } from "@std/testing/bdd";
import { Stub, stub } from "@std/testing/mock";
import {
assertEquals,
assertInstanceOf,
assertMatch,
} from "https://deno.land/std@0.170.0/testing/asserts.ts";
} from "@std/testing/asserts";
import {
_internals,
buildRequestOptions,
Expand Down
11 changes: 2 additions & 9 deletions tests/validators_test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import {
afterEach,
describe,
it,
} from "https://deno.land/std@0.170.0/testing/bdd.ts";
import {
assertEquals,
assertThrows,
} from "https://deno.land/std@0.170.0/testing/asserts.ts";
import { afterEach, describe, it } from "@std/testing/bdd";
import { assertEquals, assertThrows } from "@std/testing/asserts";
import { validateApiKey, validateTimeout } from "../src/validators.ts";
import { config, InvalidTimeoutError, MissingApiKeyError } from "../mod.ts";

Expand Down
Loading