diff --git a/.cursor/rules/unit-test.mdc b/.cursor/rules/unit-test.mdc new file mode 100644 index 000000000..2c6704f3e --- /dev/null +++ b/.cursor/rules/unit-test.mdc @@ -0,0 +1,21 @@ +--- +description: Creating unit tests +globs: +alwaysApply: false +--- + +# Creating unit tests + +- This project uses `vitest` for unit testing +- Tests are stored in the `test/` directory +- Tests should be cross-platform compatible; able to run on Windows, macOS, and linux + - e.g. the use of `path.resolve`, or `path.join` and `path.sep` to ensure that tests work the same on all platforms +- Tests should be mocked properly + - Mocks should be cleanly written and easy to understand + - Mocks should be re-usable where possible + +## Unit test style + +- Prefer the use of `test.extend` over loose variables + - To achieve this, import `test as baseTest` from `vitest` +- Never use `it`; `test` should be used in place of this \ No newline at end of file diff --git a/.github/workflows/test-comfyui-frontend.yml b/.github/workflows/test-comfyui-frontend.yml index 59bfc229d..7dbc80293 100644 --- a/.github/workflows/test-comfyui-frontend.yml +++ b/.github/workflows/test-comfyui-frontend.yml @@ -6,8 +6,21 @@ name: Test ComfyUI Frontend on: push: branches: [main, master] + paths-ignore: + - '.cursor/**' + - '.husky/**' + - '.vscode/**' + - '.github/ISSUE_TEMPLATE/**' + - 'test/**' + pull_request: branches: [main, master] + paths-ignore: + - '.cursor/**' + - '.husky/**' + - '.vscode/**' + - '.github/ISSUE_TEMPLATE/**' + - 'test/**' jobs: test-comfyui-frontend: