Skip to content

Commit

Permalink
Update tests accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
omrilotan committed Feb 15, 2024
1 parent 1969ad3 commit 9836092
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@
"page": "parcel build page/index.pug --out-dir docs --public-url ./"
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/jest": "^29.5.12",
"esbuild": "^0.20.0",
"jest": "^29.7.0",
"prettier": "^3.1.1",
"prettier": "^3.2.5",
"pug": "^3.0.2",
"stdline": "^1.1.1",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3",
"user-agents": "^1.1.53",
"user-agents": "^1.1.116",
"yaml": "^2.3.4"
}
}
4 changes: 2 additions & 2 deletions tests/spec/__snapshots__/test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
exports[`isbot module interface interface is as expected 1`] = `
[
[
"pattern",
"RegExp",
"getPattern",
"Function",
],
[
"list",
Expand Down
9 changes: 5 additions & 4 deletions tests/spec/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
pattern,
getPattern,
list,
isbot,
isbotNaive,
Expand Down Expand Up @@ -32,7 +32,7 @@ const USER_AGENT_GOTCHAS = [
describe("isbot", () => {
describe("features", () => {
test("pattern: pattern is a regex", () => {
expect(pattern).toBeInstanceOf(RegExp);
expect(getPattern()).toBeInstanceOf(RegExp);
});
test("list: list is an array", () => {
expect(list).toBeInstanceOf(Array);
Expand Down Expand Up @@ -188,8 +188,9 @@ describe("isbot", () => {
expect(types).toMatchSnapshot();
});
test("regular expressions exports are as expected", () => {
expect(pattern).toBe(regularExpression);
expect(new RegExp(fullPattern, "i").toString()).toBe(pattern.toString());
expect(new RegExp(fullPattern, "i").toString()).toBe(
getPattern().toString(),
);
});
});
});
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"noEmit": true,
"resolveJsonModule": true,
"resolveJsonModule": true
},
"include": ["src"],
"exclude": ["node_modules"],
"exclude": ["node_modules"]
}

0 comments on commit 9836092

Please sign in to comment.