-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,45 @@ | ||
# firebase-firestore-testing-action | ||
## Jest testing (including firestore rules) | ||
|
||
This action allows you to use the firestore emulator and jest to test firestore rules in ci | ||
This action runs jest to test code. It also includes the firebase firestore emulator to make it possible to also test firestore rules. | ||
|
||
## Assumptions | ||
|
||
This action assumes that: | ||
|
||
* Your file structure contains a folder in the root directory called `funcitons` which contains all your functions code. | ||
* You have the following npm scripts in your `package.json`: | ||
|
||
```javascript | ||
... | ||
"scripts": { | ||
"test": "jest", | ||
"test:ci": "firebase emulators:exec --only firestore \"npm run test\"", | ||
} | ||
... | ||
``` | ||
|
||
## Example | ||
|
||
Here is an example yaml file to run the action: | ||
|
||
```yaml | ||
name: Test | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Run Jest | ||
uses: IIIMPACT/[email protected] | ||
``` | ||
## License | ||
The Dockerfile and associated scripts and documentation in this project are released under the [MIT License](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# action.yml | ||
name: 'Firebase Firestore Testing' | ||
author: 'Bhekani Khumalo' | ||
description: 'Test firestore with the emulators and jest.' | ||
name: 'Jest testing (including firestore rules)' | ||
author: 'Bhekani Khumalo <[email protected]>' | ||
description: 'Run jest to test code, this includes the firebase firestore emulator to make it possible to also test firestore rules.' | ||
branding: | ||
icon: 'airplay' | ||
color: 'orange' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters