Testing guide
This guide explains how to test the Dynamic Tags & Folders plugin in different environments.
Table of Contents
Section titled “Table of Contents”- Environment Detection
- Building the Plugin
- Testing in Obsidian
- Creating a Test Vault
- Testing the UI
- Common Issues
Environment Detection
Section titled “Environment Detection”The plugin can be developed and tested in three main environments:
1. WSL (Windows Subsystem for Linux)
Section titled “1. WSL (Windows Subsystem for Linux)”- Running Linux commands in Windows
- Most common for development with Claude Code
- Identifier:
/proc/versioncontains “microsoft”
2. PowerShell (Windows Native)
Section titled “2. PowerShell (Windows Native)”- Native Windows environment
- Uses Windows-native Node.js and bun
- Identifier:
process.platform === 'win32'
3. Native Linux
Section titled “3. Native Linux”- Pure Linux environment (no Windows)
- Identifier:
process.platform === 'linux'without Microsoft in/proc/version
4. macOS
Section titled “4. macOS”- Apple Silicon or Intel Mac
- Identifier:
process.platform === 'darwin'
Building the Plugin
Section titled “Building the Plugin”Option 1: Using the Platform-Aware Build Script (Recommended)
Section titled “Option 1: Using the Platform-Aware Build Script (Recommended)”# Development buildnode scripts/build.mjs
# Production buildnode scripts/build.mjs --productionThis script automatically:
- Detects your environment (WSL, PowerShell, Linux, macOS)
- Finds the correct package manager (bun or npm)
- Handles esbuild platform differences
- Provides clear error messages
Option 2: Manual Build Commands
Section titled “Option 2: Manual Build Commands”In WSL or Linux
Section titled “In WSL or Linux”# If using bun (recommended)bun run build
# If using npmnpm run build
# Development with watch modebun run devIn PowerShell
Section titled “In PowerShell”# If using bunbun run build
# If using npmnpm run buildNote: If you get esbuild platform errors in WSL, you may need to:
# Remove node_modules and reinstall in WSLrm -rf node_modulesbun install# ornpm installOption 3: TypeScript Check Only
Section titled “Option 3: TypeScript Check Only”If you just want to verify the code compiles without bundling:
# WSL/Linuxbun x tsc -noEmit -skipLibCheck
# PowerShellnpx tsc -noEmit -skipLibCheckTesting in Obsidian
Section titled “Testing in Obsidian”Embedded Test Vault Approach (Recommended)
Section titled “Embedded Test Vault Approach (Recommended)”The plugin includes an embedded test vault at test-vault/. Build outputs go directly there—no copying or symlinks needed.
Setup (one-time):
# Build outputs to test-vault/.obsidian/plugins/dynamic-tags-folders/npm run buildDevelopment workflow:
# Watch mode - rebuilds automatically on changesnpm run dev
# Open test-vault/ as a vault in Obsidian# File → Open vault → select test-vault/Enable the Plugin
Section titled “Enable the Plugin”- Open Obsidian with the test-vault
- Go to Settings → Community Plugins
- Make sure Safe Mode is OFF
- Find “Dynamic Tags & Folders” in the list
- Enable the plugin
Install Hot Reload (Optional but Recommended)
Section titled “Install Hot Reload (Optional but Recommended)”For automatic plugin reloading during development:
- Install the Hot Reload community plugin in test-vault
- Enable it in Obsidian
- Now when you run
npm run dev, changes auto-reload!
Test Vault Structure
Section titled “Test Vault Structure”The test vault is embedded in the project at test-vault/. It includes sample content for testing.
Initial Setup
Section titled “Initial Setup”If test-vault/ doesn’t exist, create it:
# From the plugin project rootmkdir -p test-vault/.obsidian/plugins/dynamic-tags-foldersmkdir -p "test-vault/Projects/Web Development"mkdir -p "test-vault/Projects/Mobile Apps"mkdir -p "test-vault/📁 01 - Archive/Old Projects"mkdir -p "test-vault/📁 02 - Active/Current Work"Sample Test Notes
Section titled “Sample Test Notes”Create sample notes in test-vault/:
# Web project notecat > "test-vault/Projects/Web Development/Project1.md" << 'EOF'---tags: - projects/web---
# Web Project 1EOF
# Mobile project notecat > "test-vault/Projects/Mobile Apps/App1.md" << 'EOF'---tags: - projects/mobile---
# Mobile App 1EOF
# Untagged notecat > "test-vault/Projects/Untagged.md" << 'EOF'# Untagged Note
This note has no tags.EOFTest Vault Structure
Section titled “Test Vault Structure”Your embedded test vault should look like this:
test-vault/├── .obsidian/│ └── plugins/│ └── dynamic-tags-folders/│ ├── main.js # Build output│ ├── manifest.json│ └── styles.css├── Projects/│ ├── Web Development/│ │ └── Project1.md (tags: projects/web)│ ├── Mobile Apps/│ │ └── App1.md (tags: projects/mobile)│ └── Untagged.md (no tags)├── 📁 01 - Archive/│ └── Old Projects/└── 📁 02 - Active/ └── Current Work/Testing the UI
Section titled “Testing the UI”Test Checklist
Section titled “Test Checklist”1. Settings Tab
Section titled “1. Settings Tab”- Open Settings → Dynamic Tags & Folders
- Verify general options display correctly
- Toggle each option and verify it saves
- Check that “No rules” message appears
2. Create a Rule
Section titled “2. Create a Rule”- Click “Add Rule” button
- Rule editor modal opens
- Fill in basic information:
- Name: “Test Rule - Projects”
- Description: “Map Projects folder to tags”
- Priority: 10
- Select direction: Bidirectional
- Set folder pattern:
Projects/* - Set tag pattern:
projects/* - Configure transformations:
- Folder → Tag: snake_case, strip emoji, strip numbers
- Tag → Folder: Title Case
- Test preview section:
- Enter
Projects/Web Development→ should showprojects/web_development - Enter
web_development→ should showWeb Development
- Enter
- Click “Create Rule”
- Verify rule appears in settings list
3. Edit a Rule
Section titled “3. Edit a Rule”- Click on the rule in the list
- Modal opens with existing values
- Change priority to 5
- Click “Save Changes”
- Verify changes persist
4. Drag and Drop Reordering
Section titled “4. Drag and Drop Reordering”- Create a second rule
- Drag one rule above/below the other
- Verify priorities update automatically
5. Import/Export
Section titled “5. Import/Export”- Click “Export” button
- Verify JSON is copied to clipboard
- Paste into import text area
- Click “Import”
- Confirm replacement
- Verify settings imported correctly
6. Rule Validation
Section titled “6. Rule Validation”- Create a rule with no name
- Try to save
- Verify error message appears
- Try invalid regex pattern
[invalid( - Verify validation error
Common Issues
Section titled “Common Issues”Issue 1: esbuild Platform Mismatch
Section titled “Issue 1: esbuild Platform Mismatch”Error:
You installed esbuild for another platform than the one you're currently using.Solution (WSL):
# Remove node_modules and reinstall in WSLrm -rf node_modulesbun installSolution (PowerShell):
# Remove node_modules and reinstall in PowerShellRemove-Item -Recurse -Force node_modulesbun installIssue 2: Plugin Not Showing in Obsidian
Section titled “Issue 2: Plugin Not Showing in Obsidian”Check:
- Is the plugin folder in
.obsidian/plugins/? - Does it contain
main.jsandmanifest.json? - Is Community Plugins enabled (Safe Mode off)?
- Try restarting Obsidian
Debug:
# Check plugin files existls .obsidian/plugins/dynamic-tags-folders/
# Should show:# - main.js# - manifest.json# - styles.css (optional)Issue 3: TypeScript Errors
Section titled “Issue 3: TypeScript Errors”Check:
# Run type checkbun x tsc -noEmit -skipLibCheck
# If errors, check:# 1. Did you modify type definitions?# 2. Are imports correct?# 3. Try: rm -rf node_modules && bun installIssue 4: Hot Reload Not Working
Section titled “Issue 4: Hot Reload Not Working”Solutions:
- Restart Obsidian
- Disable and re-enable the plugin
- Check that Hot Reload plugin is enabled
- Check console (Ctrl+Shift+I) for errors
Issue 5: Permission Errors (WSL)
Section titled “Issue 5: Permission Errors (WSL)”If you get permission errors when running Claude Code commands:
# Check file ownershipls -la
# If files are owned by root, fix:sudo chown -R $USER:$USER .Issue 6: Bun Not Found
Section titled “Issue 6: Bun Not Found”WSL:
# Check bun installationwhich bun
# If not found, add to PATH in ~/.bashrc or ~/.zshrc:export PATH="$HOME/.bun/bin:$PATH"
# Reload shellsource ~/.bashrcPowerShell:
# Check bun installationGet-Command bun
# If not found, reinstall or add to PATHDebug Mode
Section titled “Debug Mode”Enable debug mode in plugin settings for detailed logging:
- Open Settings → Dynamic Tags & Folders
- Enable “Debug mode”
- Open Developer Console (Ctrl+Shift+I)
- Look for
[Dynamic Tags & Folders]logs
Running Tests
Section titled “Running Tests”Unit Tests
Section titled “Unit Tests”# Run all testsbun test
# Run tests in watch modebun test --watch
# Run specific test filebun test src/transformers/caseTransformers.test.tsCurrent test status: 156 tests passing ✅
Next Steps
Section titled “Next Steps”After verifying the UI works:
- Create test rules for your actual use cases
- Test folder → tag transformations (coming in Phase 3)
- Test tag → folder transformations (coming in Phase 3)
- Report any bugs or UX issues
Getting Help
Section titled “Getting Help”If you encounter issues:
- Check this guide first
- Check
CONTRIBUTING.mdfor development setup - Check
ENVIRONMENT_SETUP.mdfor environment-specific issues - Open an issue on GitHub with:
- Your environment (WSL/PowerShell/Linux/macOS)
- Error message
- Steps to reproduce