You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+11-25Lines changed: 11 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ApprovalTests.Java is a snapshot-based testing library that simplifies assertion
11
11
This is a multi-module Maven project with the following key modules:
12
12
13
13
-**approvaltests**: Main library containing core functionality (`Approvals.java`, writers, reporters, namers)
14
-
-**approvaltests-util**: Shared utilities and helper classes
14
+
-**approvaltests-util**: Shared utilities and helper classes (used as a dependency by approvaltests)
15
15
-**approvaltests-tests**: Integration tests and examples
16
16
-**approvaltests-util-tests**: Tests for utility classes
17
17
-**counter_display**: Sample application
@@ -23,35 +23,19 @@ The core API is in `org.approvaltests.Approvals` class, which provides static me
23
23
24
24
### Build and Test
25
25
```bash
26
-
# Full build with all tests
27
-
mvn install
28
-
29
-
# Build and test (recommended)
26
+
# Build and test via Mise (requires mise installed)
30
27
./build_and_test
31
-
32
-
# Skip tests if some are machine/locale dependent
33
-
mvn install -DskipTests
34
-
35
-
# Run tests for specific module
36
-
mvn verify -pl approvaltests-tests/
37
28
```
38
29
39
-
### Development
40
-
```bash
41
-
# Format code
42
-
mvn formatter:format
43
-
44
-
# Run just the main tests
45
-
./run_tests_without_compile_dependencies.sh
46
-
```
30
+
**Note:** The project uses [Mise](https://mise.jdx.dev/) for task automation. The `.mise.toml` file defines tasks like `build_and_test` and `format`. Java version is specified in `.java-version` file.
47
31
48
32
## Key Files and Concepts
49
33
50
-
-**Approved files**: `*.approved.*` files must be committed to source control and treated as binary in git (add `*.approved.* binary` to `.gitattributes`)
51
-
-**Received files**: Generated during test failures, showing actual output vs approved
52
-
-**Reporters**: Tools that show diffs when tests fail (IntelliJ, Beyond Compare, etc.)
53
-
-**Namers**: Determine approval file naming based on test method/class
54
-
-**Writers**: Generate the actual content to be approved
34
+
-**Approved files**: `*.approved.*` files must be committed to source control. These are automatically treated as binary in git via `.gitattributes` (`*.approved.* binary diff`)
35
+
-**Received files**: `*.received.*` files generated during test failures, showing actual output vs approved. These should not be committed
36
+
-**Reporters**: Tools that show diffs when tests fail (IntelliJ, Beyond Compare, etc.). Located in `org.approvaltests.reporters`
37
+
-**Namers**: Determine approval file naming based on test method/class. Located in `org.approvaltests.namer`
38
+
-**Writers**: Generate the actual content to be approved. Located in `org.approvaltests.writers`
55
39
56
40
## Running Single Tests
57
41
@@ -60,6 +44,8 @@ Individual test methods can be run using standard Maven/IDE approaches:
60
44
mvn test -Dtest=ClassName#methodName
61
45
```
62
46
47
+
**Note:** Tests run with `en_US` locale by default (configured in surefire plugin) to ensure consistent output across different environments.
48
+
63
49
## Code Style
64
50
65
-
The project uses the formatter plugin with configuration in `spun.xml`. Code formatting is enforced via Maven build.
51
+
There is an automatic code formatter that is used every time you build the project.
0 commit comments