Skip to content

Commit aac31d3

Browse files
committed
docs: add CONTRIBUTING.md
1 parent c2163a8 commit aac31d3

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contributing guide
2+
3+
## Testing
4+
5+
### How to run tests locally
6+
7+
Ensure you have Maven installed.
8+
Then:
9+
10+
```shell script
11+
mvn clean install
12+
cd tests
13+
mvn clean test
14+
```
15+
16+
### Test architecture
17+
18+
To test the library we use [karma](https://karma-runner.github.io/latest/index.html), [mocha](https://mochajs.org/) and [chai](https://www.chaijs.com/).
19+
20+
The tests suite is composed of 4 Maven modules:
21+
22+
- `tests-app`: The source of all the components used for testing.
23+
- `tests-app-wrapper-gwt2`: A simple GWT2 entry point that import `tests-app` and build a GWT2 js app with it.
24+
- `tests-app-wrapper-j2cl`: A simple J2CL entry point that import `tests-app` and build a J2CL js app with it.
25+
- `tests-runner`: Contains all the JS tests that runs using the built tests component.
26+
27+
The flow for GWT2 goes like this:
28+
29+
- The `tests-app` module containing the test components is built as a `gwt-lib` using [gwt-maven-plugin](https://github.com/tbroyer/gwt-maven-plugin).
30+
- `tests-app-wrapper-gwt2` imports `tests-app` and build a `gwt-app` also using [gwt-maven-plugin](https://github.com/tbroyer/gwt-maven-plugin). The target JS files are stored in `tests-app-wrapper-gwt2/target/vue-gwt-tests-app-wrapper-gwt2-XX-SNAPSHOT/VueGwtTestsAppGwt2/*.js`.
31+
- `tests-runner` runs `tests-runner/src/test/javascript/karma.conf.ci.gwt2.js` with Karma using [frontend-maven-plugin](https://github.com/eirslett/frontend-maven-plugin). This loads the GWT2 output JS and the JS tests in Chrome and runs all the tests against the built components.
32+
33+
The flow for J2CL goes like this:
34+
35+
- The `tests-app` module containing the test components is built as a `gwt-lib` using [gwt-maven-plugin](https://github.com/tbroyer/gwt-maven-plugin), this ends up just being a jar with the source and generated sources.
36+
- `tests-app-wrapper-j2cl` imports `tests-app` and build a J2CL app using [j2cl-maven-plugin](https://github.com/Vertispan/j2clmavenplugin). The target JS files are stored in `tests-app-wrapper-j2cl/target/vue-gwt-tests-app-wrapper-j2cl-XX-SNAPSHOT/VueGwtTests.j2cl.js`.
37+
- `tests-runner` runs `tests-runner/src/test/javascript/karma.conf.ci.j2cl.js` with Karma using [frontend-maven-plugin](https://github.com/eirslett/frontend-maven-plugin). This loads the J2CL output JS and the JS tests in Chrome and runs all the tests against the built components.

0 commit comments

Comments
 (0)