Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 19 additions & 12 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
name: "Copilot Environment Setup"

on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
# Trigger for PR creation or updates
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
types:
- opened
- reopened
- synchronize
# Trigger for PR reviews
pull_request_review:
types:
- submitted
- edited
- dismissed
# Trigger for comments on PRs
issue_comment:
types:
- created
- edited

jobs:
copilot-setup-steps:
Expand All @@ -17,10 +27,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
uses: actions/setup-node@v4
with:
node-version: "22.19"
cache: "npm"
Expand All @@ -30,17 +40,14 @@ jobs:
curl -fsSL https://bun.sh/install | bash
echo "$HOME/.bun/bin" >> $GITHUB_PATH
echo "$HOME/.bun/bin" >> $HOME/.profile
export PATH="$HOME/.bun/bin:$PATH"
echo "PATH=$HOME/.bun/bin:$PATH" >> $GITHUB_ENV

- name: Install project dependencies (npm)
run: npm install

- name: Install project dependencies (bun)
run: bun i

# - name: Install project dependencies (bun)
# run: bun playwright:install && bun i -g playwright
#
- name: Install Dev Tools
run: |
bun i -g eslint prettier
6 changes: 3 additions & 3 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
build:
uses: ./.github/workflows/build.yml

# unit:
# uses: ./.github/workflows/unit.yml
unit:
uses: ./.github/workflows/unit.yml
# e2e:
# uses: ./.github/workflows/e2e.yml
deploy:
needs: [lint, build] # [lint, unit, build, e2e]
needs: [lint, build, unit] # [lint, unit, build, e2e]
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/deploy-pages.yml
51 changes: 51 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Unit Tests

on:
workflow_dispatch:
workflow_call:

permissions:
contents: read

jobs:
unit-tests:
runs-on: ubuntu-latest
name: Unit Tests
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22.19"
cache: "npm"

- name: Install Bun
run: |
sudo apt-get update
sudo apt-get install -y unzip
curl -fsSL https://bun.sh/install | bash
echo "$HOME/.bun/bin" >> $GITHUB_PATH

- name: Install dependencies
run: bun i

- name: Run unit tests with coverage
run: bun test:unit

- name: Upload all unit test results as artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: unit-test-results
path: tests/results/
retention-days: 3

- name: Add artifact download info to summary
run: |
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "### :package: Unit Test Artifacts" >> $GITHUB_STEP_SUMMARY
echo "- Artifacts for this run are available under the **Artifacts** section at [this workflow run]($RUN_URL)." >> $GITHUB_STEP_SUMMARY
echo "- Or use GitHub CLI: \`gh run download ${{ github.run_id }} -n unit-test-results\`" >> $GITHUB_STEP_SUMMARY
136 changes: 131 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,141 @@
# 𝙄𝙂𝙉𝙊𝙍𝙀 𝙈𝙀! 🙈
.DS_Store
node_modules/
*.tmp
dist/
tests/results/
test-results/
joint.bin
joint.json
# Ignore all session files (named sessions create their own .bin and .json files)
*.bin
*.json
!package.json
!jslint.json
node_modules/
package-lock.json
# os files
$RECYCLE.BIN/
*.DS_Store
*.cab
*.lcov
*.lnk
*.log
*.mo
*.msi
*.msix
*.msm
*.msp
*.o
*.pid.lock
*.pyc
*.so
*.stackdump
*.tgz
*.tmp
public/test_touch_bridge.html
public/test_freehand_tool.html
dist/
*.tsbuildinfo
*~
.*.sw?
.AppleDB
.AppleDesktop
.AppleDouble
.DS_Store
.DocumentRevisions-V100
.LSOverride
.Spotlight-V100
.TemporaryItems
.Trash-*
.Trashes
.VolumeIcon.icns
._*
.apdisk
.cache
.com.apple.timemachine.donotpresent
.directory
.docusaurus
.dynamodb/
.env
.env.development.local
.env.local
.env.production.local
.env.test.local
.eslintcache
.fseventsd
.fuse_hidden*
.fusebox/
.grunt
.idea
.lock-wscript
.netrwhist
.next
.nfs*
.node_repl_history
.npm
.nuxt
.nyc_output
.parcel-cache
.pnp.*
.pnpm-debug.log*
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
.serverless/
.stylelintcache
.temp
.tern-port
.vscode-test
.vuepress/dist
.yarn-integrity
.yarn/build-state.yml
.yarn/cache
.yarn/install-state.gz
.yarn/unplugged
.cache/clangd/
.ccls-cache/
.clang-tidy
.clangd/
.deps/
.idea/
.vs/
.vscode/
.zig-cache/
tmp/
zig-out/
src/ui/i/proj/
src/ui/i/thumb/
src/ui/i/me.jpg
src/ui/i/signature.png
Icon[]
Network Trash Folder
Session.vim
Sessionx.vim
Temporary Items
Thumbs.db
Thumbs.db:encryptable
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]*.un~
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
[Dd]esktop.ini
_.log
_.pid
_.seed
bower_components
build/Release
coverage
ehthumbs.db
ehthumbs_vista.db
jspm_packages/
lerna-debug.log*
lib-cov
logs
nohup.out
npm-debug.log_
out
pids
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
tags
web_modules/
yarn-debug.log*
yarn-error.log*
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,27 @@ bun lint
bun lint:fix
```

### Running Unit Tests

The project includes comprehensive unit tests for utilities, palette logic, and core functions:

```sh
# Run unit tests
npm run test:unit

# or using bun
bun test:unit
```

The unit tests cover:
- Palette creation and color conversion utilities
- Unicode and UTF-8 character handling
- File format utilities and binary data processing
- Canvas coordinate system and character encoding
- DOM utility functions

Test files are located in `tests/unit/` and use **Vitest** with **jsdom** environment for testing isolated logic functions.

### Running the Server

The collaboration server can be started with:
Expand Down
Loading