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: CONTRIBUTING.md
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -27,3 +27,31 @@ pnpm i
27
27
See the [GitHub Issues](https://github.com/jthegedus/svelte-adatper-firebase/issues) list for any open Issue, especially those marked as `help wanted`
28
28
29
29
General improvements to any aspect of this adapter are welcome, just ensure major work is preceeded by a conversation in a [GitHub Issue](https://github.com/jthegedus/svelte-adatper-firebase/issues).
30
+
31
+
## Tests
32
+
33
+
As an integration point between [SvelteKit](https://kit.svelte.dev) and Firebase Hosting with Function rewrites the tests for this package are **important**.
34
+
35
+
The test suite is broken into three categories:
36
+
37
+
-**unit**: test internal functions to the CLI & entrypoint JS code
38
+
-**integration**: runs the `build` command of SvelteKit with demo apps that tests each path of the src/index.js CLI entrypoint.
39
+
-**end-to-end**: runs a shell script which:
40
+
- creates the SvelteKit Todo skeleton app (via `npm init@svelte <dir>`)
41
+
- adds Firebase configuration for Hosting & Cloud Functions
42
+
- adds `svelte-adapter-firebase` (relative add of the repo root, not from `npmjs.com`, to test current code changes before publishing)
43
+
- creates the Cloud Function which hosts the compiled SvelteKit app (this is the code in `functions/index.js` that the CLI would prompt the user to add)
44
+
- installs all dependencies for the Todo app & Cloud Functions
45
+
- builds the app
46
+
- starts the Firebase Emulator with Hosting & Functions
47
+
- makes `curl` requests to the Todo app
48
+
- GET to `/`
49
+
- GET to `/about`
50
+
- GET to `/todos`
51
+
- POST with formdata to `/todos`
52
+
53
+
- Unit tests are run pre-push. They can be run manually with `pnpm run test`
54
+
- Integration tests are run in CI.
55
+
- End-to-end tests are run in CI. This script can be run locally with `./tests/end-to-end/test.bash`
56
+
57
+
All test suites are run in CI pipelines on PR creation.
0 commit comments