Skip to content

Commit

Permalink
Merge pull request #137 from barrymun/feature/vitest-test-suite
Browse files Browse the repository at this point in the history
Feature - Vitest test suite for utility functions
  • Loading branch information
Mathys-Gasnier authored Jan 12, 2025
2 parents 48048cd + 068c831 commit d5c276c
Show file tree
Hide file tree
Showing 25 changed files with 2,426 additions and 604 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/check-snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ jobs:
with:
node-version: 22

- name: Install dependencies
run: npm ci

- name: Check if snippets are formated correctly
uses: int128/comment-action@v1
with:
run: node utils/checkSnippetFormatting.js # Run the script located in the utils/ folder
run: npx tsx utils/checkSnippetFormatting.ts # Run the script located in the utils/ folder
post-on-failure: |
## :x: Snippet Format Error
${run.output}
${run.output}
3 changes: 3 additions & 0 deletions .github/workflows/pre-commit-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ jobs:
- name: Run lint
run: npm run lint

- name: Run tests
run: npm run test-ci

- name: Run build
run: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lerna-debug.log*
node_modules
dist
dist-ssr
coverage
*.local
*.tsbuildinfo

Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
npm run snippets:check
npm run cspell
npm run lint
npm run test-ci
npm run build
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
node_modules
dist
coverage
snippets
public
.vite
coverage
package-lock.json
.md
.md
1 change: 1 addition & 0 deletions cspell-dict.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
quicksnip
slugified
slugifyed
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"ignorePaths": [
"node_modules",
"dist",
"coverage",
"public"
]
}
8 changes: 4 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { fixupPluginRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import globals from "globals";
import prettier from "eslint-plugin-prettier/recommended";
import reactPlugin from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import tseslint from "typescript-eslint";
import prettier from "eslint-plugin-prettier/recommended";

const project = "./tsconfig.app.json";
// eslint flat structure backwards compatibility
Expand All @@ -23,7 +23,7 @@ function legacyPlugin(name, alias = name) {
}

export default tseslint.config(
{ ignores: ["node_modules", "dist", "build"] },
{ ignores: ["node_modules", "dist", "coverage"] },
{
extends: [
js.configs.recommended,
Expand All @@ -32,7 +32,7 @@ export default tseslint.config(
...compat.extends("plugin:import/typescript"),
reactPlugin.configs.flat.recommended,
],
files: ["**/*.{ts,tsx}"],
files: ["**/*.{js,ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
Expand Down
Loading

0 comments on commit d5c276c

Please sign in to comment.