Skip to content

Commit

Permalink
Reorganizing unit test setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
getvictor committed Jul 25, 2024
1 parent ee83d35 commit ce9c354
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.idea/
/coverage/
/dist/
/node_modules/

Expand Down
3 changes: 2 additions & 1 deletion __mocks__/chrome.js → __mocks__/chrome.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global global, jest -- for eslint */
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
global.chrome = {
runtime: {
onMessage: {
Expand Down
9 changes: 0 additions & 9 deletions jest.config.mjs

This file was deleted.

12 changes: 12 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { JestConfigWithTsJest } from "ts-jest"

const config: JestConfigWithTsJest = {
collectCoverageFrom: ["src/**/*.ts"],
setupFiles: ["./__mocks__/chrome.ts"],
testEnvironment: "jsdom",
transform: {
"^.+.ts$": ["ts-jest", {}],
},
}
// noinspection JSUnusedGlobalSymbols
export default config
3 changes: 0 additions & 3 deletions src/content.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* @jest-environment jsdom
*/
import { blurFilter, handleMessage } from "./content"
import { Message } from "./constants"

Expand Down

0 comments on commit ce9c354

Please sign in to comment.