Skip to content

Commit fd3218c

Browse files
authored
Merge pull request #127 from deploystackio/feat/test
feat(docs): enhance documentation for available commands, parser examples, project structure, publishing process, and testing guidelines
2 parents 4a4461a + d834ea6 commit fd3218c

File tree

5 files changed

+713
-253
lines changed

5 files changed

+713
-253
lines changed

docs/docker-to-iac/available-commands.md

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,71 @@ menuTitle: Available Commands
77

88
The following commands are currently supported:
99

10+
## Build Commands
11+
1012
- `npm run build`
11-
- Will build the module and create output files inside `dist/` direcotry.
13+
- Builds the module using TypeScript compiler and creates output files inside the `dist/` directory.
14+
15+
## Code Quality Commands
16+
1217
- `npm run lint`
13-
- Will run eslint command. ESLint is also run as part of GitHub action test for new pull request on the default `main` branch.
18+
- Runs ESLint to check code quality. ESLint is also run as part of GitHub action test for new pull requests on the default `main` branch.
19+
20+
## Testing Commands
21+
1422
- `npm run test`
15-
- Runs the tests defined in the `test/test.ts` file. The tests are also part of the GitHub action pipeline for new pull requests into `main`.
16-
- `npm run semantic-release`
17-
- Runs the semantic-release command which is part of the release process of [docker-to-iac](https://www.npmjs.com/package/@deploystack/docker-to-iac) modules to npm registry. The release is executed through a [GitHub action pipeline](/docs/docker-to-iac/publishing-to-npm.md).
23+
- Runs the complete test suite including both unit tests and end-to-end tests.
24+
- `npm run test:unit`
25+
- Runs only the unit tests to validate individual components.
26+
- `npm run test:e2e`
27+
- Runs only the end-to-end tests which validate the entire translation process from Docker run commands or Docker Compose files to infrastructure as code.
28+
- `npm run test:watch`
29+
- Runs tests in watch mode, which automatically re-runs tests when files change.
30+
- `npm run test:coverage`
31+
- Runs tests with coverage reporting to identify untested code paths.
32+
33+
## Release Commands
34+
35+
- `npm run release`
36+
- Runs the release-it command which is part of the release process of [docker-to-iac](https://www.npmjs.com/package/@deploystack/docker-to-iac) modules to npm registry. The release is executed through configurations defined in `.release-it.js`.
37+
38+
## Other Commands
39+
40+
- `npm run pretest:e2e`
41+
- Automatically run before e2e tests to clean the output directory.
42+
43+
You can view all commands and their configurations in the [package.json](https://github.com/deploystackio/docker-to-iac/blob/main/package.json) file.
44+
45+
## Examples
46+
47+
### Running Unit Tests Only
48+
49+
```bash
50+
npm run test:unit
51+
```
52+
53+
### Running End-to-End Tests Only
54+
55+
```bash
56+
npm run test:e2e
57+
```
58+
59+
### Running All Tests with Coverage
60+
61+
```bash
62+
npm run test:coverage
63+
```
64+
65+
### Building the Module
66+
67+
```bash
68+
npm run build
69+
```
70+
71+
### Checking Code Quality
72+
73+
```bash
74+
npm run lint
75+
```
1876

19-
View all commands config from [package.json](https://github.com/deploystackio/docker-to-iac/blob/main/package.json).
77+
Each command is configured to provide the most relevant feedback for its purpose. For example, unit tests provide detailed output about each individual function, while end-to-end tests show a summary of the complete translation process from Docker configurations to infrastructure as code.

0 commit comments

Comments
 (0)