Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
disable instrumentation for SessionLock
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Aug 16, 2023
1 parent 3fb3504 commit b3bee0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ const config: Config = {
"RecorderWorklet": "<rootDir>/__mocks__/empty.js",
},
transformIgnorePatterns: ["/node_modules/(?!matrix-js-sdk).+$"],
collectCoverageFrom: ["<rootDir>/src/**/*.{js,ts,tsx}"],
collectCoverageFrom: [
"<rootDir>/src/**/*.{js,ts,tsx}",
// getSessionLock is piped into a different JS context via stringification, and the coverage functionality is
// not available in that contest. So, turn off coverage instrumentation for it.
"!<rootDir>/src/utils/SessionLock.ts",
],
coverageReporters: ["text-summary", "lcov"],
testResultsProcessor: "@casualbot/jest-sonar-reporter",
};
Expand Down
1 change: 1 addition & 0 deletions test/utils/SessionLock-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ describe("SessionLock", () => {
window2._logger = require("matrix-js-sdk/src/logger");

// now, define getSessionLock as a global
const x = getSessionLock;

Check failure on line 221 in test/utils/SessionLock-test.ts

View workflow job for this annotation

GitHub Actions / ESLint

'x' is assigned a value but never used

Check failure on line 221 in test/utils/SessionLock-test.ts

View workflow job for this annotation

GitHub Actions / Typescript Syntax Check

'x' is declared but its value is never read.
window2.eval(String(getSessionLock));

// return a function that will call it
Expand Down

0 comments on commit b3bee0d

Please sign in to comment.