Skip to content

Commit

Permalink
ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
djobbo committed Apr 10, 2024
1 parent f3b645f commit 1a3b924
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 131 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/code-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ jobs:
action: pnpm ts:check
- name: Deadcode
action: pnpm deadcode
- name: Test
action: pnpm test
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.5.0
version: 8.15.6
- uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: ${{ matrix.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type CharacterQuizChoiceStep } from "@/data/levels"
import { useState } from "react"
import { Button } from "@/components/Button"
import { CharacterDisplay } from "@/components/CharacterDisplay"
import { useLevelStore } from "./LevelStoreProvider"
import { useLevelStore } from "@/store/LevelStore"

type CharacterQuizChoiceStepContentProps = {
step: CharacterQuizChoiceStep
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { renderWithContext } from "@/test-utils/renderWithContext"
import { KeywordChallengeStepContent } from "./KeywordChallengeStepContent"
import { StepType } from "@/data/levels"

describe("KeywordChallengeStepContent", () => {
it("should render successfully", () => {
expect(() => {
renderWithContext(
<KeywordChallengeStepContent
step={{
type: StepType.KEYWORD_CHALLENGE,
keyword: "うえ",
pronounciation: [["u"], ["e"]],
}}
/>,
)
}).not.toThrow()
})
})
2 changes: 1 addition & 1 deletion app/level/[level]/round/[round]/Round.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { useLevelStore } from "./LevelStoreProvider"
import { useLevelStore } from "@/store/LevelStore"
import { observer } from "mobx-react-lite"
import { Step } from "./Step"

Expand Down
2 changes: 1 addition & 1 deletion app/level/[level]/round/[round]/Step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { InfoStepContent } from "./InfoStepContent"
import { CharacterQuizChoiceStepContent } from "./CharacterQuizChoiceStepContent"
import { KeywordChallengeStepContent } from "./KeywordChallengeStepContent"
import { observer } from "mobx-react-lite"
import { useLevelStore } from "./LevelStoreProvider"
import { useLevelStore } from "@/store/LevelStore"
import { AnimatePresence } from "framer-motion"
import { StepType } from "@/data/levels"

Expand Down
2 changes: 1 addition & 1 deletion app/level/[level]/round/[round]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import z from "zod"
import { levels } from "@/data/levels"
import { RedirectType, redirect } from "next/navigation"
import { Round } from "./Round"
import { LevelStoreProvider } from "./LevelStoreProvider"
import { LevelStoreProvider } from "@/store/LevelStore"

const paramsSchema = z.object({
level: z.number({ coerce: true }).int().catch(1),
Expand Down
13 changes: 13 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const nextJest = require("next/jest.js")

const createJestConfig = nextJest({
dir: "./",
})

/** @type {import('jest').Config} */
const config = {
coverageProvider: "v8",
testEnvironment: "jsdom",
}

module.exports = createJestConfig(config)
13 changes: 0 additions & 13 deletions jest.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"postcss": "^8",
"prettier": "^3.2.5",
"tailwindcss": "^3.3.0",
"ts-node": "^10.9.2",
"typescript": "^5.4.4"
}
}
Loading

0 comments on commit 1a3b924

Please sign in to comment.