Skip to content

Commit

Permalink
chore: adding/setting up related test framework stuff
Browse files Browse the repository at this point in the history
And fixing the only test so that TS is happy
  • Loading branch information
smoak committed Jan 27, 2024
1 parent 251a25b commit e0cea1c
Show file tree
Hide file tree
Showing 5 changed files with 7,956 additions and 4,319 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe("ScoringType", () => {
let container: HTMLElement;

beforeEach(() => {
container = render(<ScoringType goalType="ev" />).container;
container = render(<ScoringType goalType="Even" />).container;
});

it("should render empty", () => {
Expand All @@ -16,7 +16,7 @@ describe("ScoringType", () => {

describe("when rendered with a short handed goal", () => {
beforeEach(() => {
render(<ScoringType goalType="sh" />);
render(<ScoringType goalType="ShortHanded" />);
});

it("should render `SHG`", () => {
Expand All @@ -26,7 +26,7 @@ describe("ScoringType", () => {

describe("when rendered with a power play goal", () => {
beforeEach(() => {
render(<ScoringType goalType="pp" />);
render(<ScoringType goalType="PowerPlay" />);
});

it("should render `PP`", () => {
Expand All @@ -36,7 +36,7 @@ describe("ScoringType", () => {

describe("when rendered with a empty net goal", () => {
beforeEach(() => {
render(<ScoringType goalType="en" />);
render(<ScoringType goalType="EmptyNet" />);
});

it("should render `EN`", () => {
Expand Down
1 change: 1 addition & 0 deletions config/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@testing-library/jest-dom";
30 changes: 30 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "jsdom",
collectCoverage: true,
collectCoverageFrom: [
"app/**/*.ts(x)",
"api/**/*.(t|j)sx?$",
"!app/root.tsx",
"!app/entry.client.tsx",
"!app/entry.server.tsx",
"!app/routes/**/*.tsx",
"!app/**/stories.tsx",
],
coverageDirectory: "coverage",
coverageThreshold: {
global: {
branches: 1,
functions: 1,
lines: 1,
statements: 1,
},
},
testPathIgnorePatterns: ["/node_modules/", ".cache/"],
moduleNameMapper: {
"^~/(.*)$": "<rootDir>/app/$1",
},
roots: ["<rootDir>"],
setupFilesAfterEnv: ["<rootDir>/config/jest.setup.ts"],
};
Loading

0 comments on commit e0cea1c

Please sign in to comment.