@@ -124,18 +124,23 @@ This script generates:
124
124
- Accurate description and usage examples
125
125
- Correct icon path (usually ` ../../../../.icons/your-icon.svg ` )
126
126
- 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
128
130
4 . ** Add any scripts** or additional files your module needs
129
131
130
132
### 4. Test and Submit
131
133
132
134
``` 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
134
139
terraform init -upgrade
135
140
terraform test -verbose
136
141
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
139
144
140
145
# Format code
141
146
bun run fmt
@@ -343,8 +348,8 @@ coder templates push test-[template-name] -d .
343
348
terraform init -upgrade
344
349
terraform test -verbose
345
350
346
- # Test all modules
347
- ./scripts/terraform_test_all.sh
351
+ # Optional: If you have TypeScript tests
352
+ bun test main.test.ts
348
353
```
349
354
350
355
### 3. Maintain Backward Compatibility
@@ -393,7 +398,9 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
393
398
### Every Module Must Have
394
399
395
400
- ` 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.)
397
404
- ` README.md ` - Documentation with frontmatter
398
405
399
406
### Every Template Must Have
@@ -493,7 +500,7 @@ When reporting bugs, include:
493
500
2 . ** No tests** or broken tests
494
501
3 . ** Hardcoded values** instead of variables
495
502
4 . ** 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
497
504
498
505
## For Maintainers
499
506
0 commit comments