@@ -124,18 +124,23 @@ This script generates:
124124 - Accurate description and usage examples
125125 - Correct icon path (usually ` ../../../../.icons/your-icon.svg ` )
126126 - Proper tags that describe your module
127- 3 . ** Create at least one ` .tftest.hcl ` ** to test your module with ` terraform test `
127+ 3 . ** Create tests for your module:**
128+ - ** Terraform tests** : Create a ` *.tftest.hcl ` file and test with ` terraform test `
129+ - ** TypeScript tests** : Create ` main.test.ts ` file if your module runs scripts or has business logic that Terraform tests can't cover
1281304 . ** Add any scripts** or additional files your module needs
129131
130132### 4. Test and Submit
131133
132134``` bash
133- # Test your module (from the module directory)
135+ # Test your module
136+ cd registry/[namespace]/modules/[module-name]
137+
138+ # Required: Test Terraform functionality
134139terraform init -upgrade
135140terraform test -verbose
136141
137- # Or run all tests in the repo
138- ./scripts/terraform_test_all.sh
142+ # Optional: Test TypeScript files if you have main.test.ts
143+ bun test main.test.ts
139144
140145# Format code
141146bun run fmt
@@ -343,8 +348,8 @@ coder templates push test-[template-name] -d .
343348terraform init -upgrade
344349terraform test -verbose
345350
346- # Test all modules
347- ./scripts/terraform_test_all.sh
351+ # Optional: If you have TypeScript tests
352+ bun test main.test.ts
348353```
349354
350355### 3. Maintain Backward Compatibility
@@ -393,7 +398,9 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
393398### Every Module Must Have
394399
395400- ` main.tf ` - Terraform code
396- - One or more ` .tftest.hcl ` files - Working tests with ` terraform test `
401+ - ** Tests** :
402+ - ` *.tftest.hcl ` files with ` terraform test ` (to test terraform specific logic)
403+ - ` main.test.ts ` file with ` bun test ` (to test business logic, i.e., ` coder_script ` to install a package.)
397404- ` README.md ` - Documentation with frontmatter
398405
399406### Every Template Must Have
@@ -493,7 +500,7 @@ When reporting bugs, include:
4935002 . ** No tests** or broken tests
4945013 . ** Hardcoded values** instead of variables
4955024 . ** Breaking changes** without defaults
496- 5 . ** Not running** formatting (` bun run fmt ` ) and tests (` terraform test ` ) before submitting
503+ 5 . ** Not running** formatting (` bun run fmt ` ) and tests (` terraform test ` , and ` bun test main.test.ts ` if applicable ) before submitting
497504
498505## For Maintainers
499506
0 commit comments