Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Vitest test suite for utility functions #137

Merged
merged 20 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
31051e3
add vitest package, update pre-commit scripts to include the test com…
barrymun Jan 2, 2025
374455c
Merge branch 'main' into feature/vitest-test-suite
barrymun Jan 2, 2025
7871367
Merge branch 'main' into feature/vitest-test-suite
barrymun Jan 3, 2025
f5ea3ed
moving all tests within the tests directory at the root of the project
barrymun Jan 3, 2025
3f42a75
Merge branch 'main' into feature/vitest-test-suite
barrymun Jan 3, 2025
ef33bf2
installing tsx, converting root level utils/ scripts to .ts files, ad…
barrymun Jan 3, 2025
05e49b3
Merge branch 'main' into feature/vitest-test-suite
barrymun Jan 3, 2025
607d314
update pre-commit checks and workflow scrips
barrymun Jan 3, 2025
7d1d241
move code prop to undo consolidation changes
barrymun Jan 3, 2025
ccc4cc0
remove duplicate code in script
barrymun Jan 3, 2025
411ccb8
testing tsx usage in workflow
barrymun Jan 3, 2025
8d63d17
prefix tsx calls with npx in workflows
barrymun Jan 3, 2025
f8d41da
install deps in check-snippets script
barrymun Jan 3, 2025
5dcad06
revert arg object structure conversion for the parseSnippet function
barrymun Jan 3, 2025
e0c04f2
Merge branch 'main' into feature/vitest-test-suite
barrymun Jan 9, 2025
4208ae8
update scripts
barrymun Jan 9, 2025
97adaaf
Merge branch 'main' into feature/vitest-test-suite
barrymun Jan 10, 2025
0167af2
remove unused file
barrymun Jan 10, 2025
d18a7b9
Merge branch 'main' into feature/vitest-test-suite
barrymun Jan 10, 2025
068c831
replace Array<> generic type with the shorthand []
barrymun Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check-snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Check if snippets are formated correctly
uses: int128/comment-action@v1
Mathys-Gasnier marked this conversation as resolved.
Show resolved Hide resolved
with:
run: node utils/checkSnippetFormatting.js # Run the script located in the utils/ folder
run: tsx utils/checkSnippetFormatting.ts # Run the script located in the utils/ folder
Mathys-Gasnier marked this conversation as resolved.
Show resolved Hide resolved
post-on-failure: |
## :x: Snippet Format Error
${run.output}
${run.output}
4 changes: 2 additions & 2 deletions .github/workflows/consolidate-snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:

- name: Install dependencies
run: |
npm install
npm ci

- name: Consolidate Snippets
run: |
node utils/consolidateSnippets.js # Run the script located in the utils/ folder
tsx utils/consolidateSnippets.ts # Run the script located in the utils/ folder

- name: Commit and push changes
run: |
Expand Down
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
Loading