Skip to content

Commit 175ad45

Browse files
authored
Merge pull request #479 from 2chanhaeng/cli/init/test
Add `deno task test-init` for testing `fedify init` and fixed `fedify init` CLI with it
2 parents 0e4c2ed + a931db1 commit 175ad45

39 files changed

Lines changed: 1784 additions & 863 deletions

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,47 @@ with Node.js and Bun.
403403
> mise install
404404
> ~~~~
405405
406+
#### Testing the `init` command
407+
408+
If you want to test some integration packages like `@fedify/hono` or
409+
`@fedify/denokv`, you can test them with `test-init` task. This task runs
410+
the `fedify init` command with various combinations of web frameworks,
411+
package managers, KvStore implementations, and MessageQueue implementations.
412+
413+
~~~~ bash
414+
# From /packages/cli
415+
deno task test-init
416+
~~~~
417+
418+
You can also specify specific options to test:
419+
420+
~~~~ bash
421+
# Test with specific web framework and package manager
422+
deno task test-init -w hono -p deno
423+
424+
# Test with multiple options
425+
deno task test-init -w hono -w express -p deno -p npm -k denokv -m denokv
426+
~~~~
427+
428+
If some options are not specified, all combinations are tested by default.
429+
430+
You can skip dry run or hydration tests:
431+
432+
~~~~ bash
433+
deno task test-init --no-dry-run # Only run hydration tests
434+
deno task test-init --no-hyd-run # Only run dry-run tests
435+
~~~~
436+
437+
The test results are stored in `/tmp/fedify-init/<run-id>/`(UNIX).
438+
439+
> [!NOTE]
440+
>
441+
> The `test-init` command is for contributors only and is not exposed in the
442+
> public CLI. It uses the `FEDIFY_TEST_MODE` environment variable internally
443+
> to configure the init command to use local workspace packages instead of
444+
> published versions.
445+
446+
406447
### Building the docs
407448

408449
If you want to change the Fedify docs, you would like to preview the changes

0 commit comments

Comments
 (0)