Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weareoutman committed Aug 12, 2024
1 parent 0d70f63 commit c04468a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"overrides": [
{
"files": ["*.config.js", "__jest__/**/*.js"],
"files": ["jestSetup.js", "*.config.js", "__jest__/**/*.js"],
"env": {
"node": true,
"browser": false
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
moduleNameMapper: {
"\\.module\\.css$": require.resolve("identity-obj-proxy"),
"@docusaurus/Translate": "<rootDir>/__mocks__/Translate.js",
"^cheerio$": require.resolve("cheerio"),
},
// Ref https://github.com/facebook/jest/issues/2070#issuecomment-431706685
// Todo(steve): remove next line when issue fixed.
Expand Down
4 changes: 4 additions & 0 deletions jestSetup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { matcherHint, printExpected, printReceived } from "jest-matcher-utils";
import { TextEncoder, TextDecoder } from "node:util";
import { ReadableStream } from "node:stream/web";

Object.assign(global, { TextDecoder, TextEncoder, ReadableStream });

const passMessage = (actual, expected) => () =>
`${matcherHint(".not.toMatchPath")}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"babel-jest": "^28.1.0",
"cheerio": "^1.0.0",
"cross-env": "^7.0.3",
"eslint": "^8.15.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14909,6 +14909,7 @@ __metadata:
"@typescript-eslint/eslint-plugin": "npm:^6.10.0"
"@typescript-eslint/parser": "npm:^6.10.0"
babel-jest: "npm:^28.1.0"
cheerio: "npm:^1.0.0"
cross-env: "npm:^7.0.3"
eslint: "npm:^8.15.0"
eslint-config-prettier: "npm:^8.5.0"
Expand Down

0 comments on commit c04468a

Please sign in to comment.