This directory contains the test suite for Kimera.js. Tests are organized by the permissions they require.
Tests are organized into subdirectories based on the permissions they need:
basic/ - Tests that don't require any special permissions
fs/ - Tests requiring filesystem access (--fs flag)
net/ - Tests requiring network access (--net flag)
env/ - Tests requiring environment variable access (--env flag)
combined/ - Tests requiring multiple permissions (--fs --env)
The CI system automatically runs all tests with appropriate permissions:
go build -o kimera
# Tests are run automatically by directory
Run tests in a specific directory with the appropriate flags:
# Filesystem tests
./kimera run testings/fs/file-read.js --fs
# Network tests
./kimera run testings/net/fetch-get.js --net
# Environment tests
./kimera run testings/env/permission-env-allowed.js --env
# Combined permission tests
./kimera run testings/combined/permission-demo.js --fs --env
# Basic tests (no flags needed)
./kimera run testings/basic/globals.js
When adding new tests, place them in the appropriate directory:
Determine required permissions - What system access does your test need?
fs/net/env/combined/basic/Create your test file - Use descriptive names:
file-read-binary.js, fetch-headers.jstest1.js, mytest.jsFollow test conventions:
console.log() for outputNo manual CI updates needed - The CI automatically discovers and runs tests based on directory structure!
Use descriptive, kebab-case names that indicate what the test does:
file-read.js - Clear and descriptivefetch-post-json.js - Specific about what it testspermission-fs-denied.js - Clear about expected behaviortest.js - Too genericmyNewTest.js - Not consistent with project style--fs - Enables filesystem read/write operations--net - Enables network/HTTP operations--env - Enables environment variable accessTests are automatically run with the appropriate flags based on their directory.