Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run tests against Firebase emulator #293

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:
strategy:
matrix:
node-version:
- 14.x
- 20.x
- 22.x
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -29,7 +30,10 @@ jobs:
- run: npm install
- run: npm run bootstrap
- run: npm run lint
- run: npm run test
- name: Run tests against emulator
run: |
npm install -g firebase-tools
firebase emulators:exec --only database --project fake-project-id 'npm run test'
- run: npm run coverage

- name: Coveralls
Expand Down
7 changes: 4 additions & 3 deletions examples/fish1/js/fish1.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
(function() {
// Initialize the Firebase SDK
// TODO(DEVELOPER): Change the values below using values from the initialization snippet: Firebase Console > Overview > Add Firebase to your web app.
initializeApp({
apiKey: "AIzaSyCR4ND2xwX3kU1IxTn0youF5OlI3x6MFZs",
databaseURL: "https://geofire-gh-tests.firebaseio.com",
projectId: "geofire-gh-tests"
apiKey: "<YOUR_API_KEY>",
databaseURL: "<YOUR_DB_URL>",
projectId: "<YOUR_PROJECT_ID>"
});

// Generate a random Firebase location
Expand Down
6 changes: 3 additions & 3 deletions examples/fish2/js/fish2.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(function() {
// Initialize the Firebase SDK
initializeApp({
apiKey: "sAIzaSyCR4ND2xwX3kU1IxTn0youF5OlI3x6MFZs",
databaseURL: "https://geofire-gh-tests.firebaseio.com",
projectId: "geofire-gh-tests"
apiKey: "s<YOUR_API_KEY>",
databaseURL: "<YOUR_DB_URL>",
projectId: "<YOUR_PROJECT_ID>"
});

// Generate a random Firebase location
Expand Down
6 changes: 3 additions & 3 deletions examples/fish3/js/fish3.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(function() {
// Initialize the Firebase SDK
initializeApp({
apiKey: "AIzaSyCR4ND2xwX3kU1IxTn0youF5OlI3x6MFZs",
databaseURL: "https://geofire-gh-tests.firebaseio.com",
projectId: "geofire-gh-tests"
apiKey: "<YOUR_API_KEY>",
databaseURL: "<YOUR_DB_URL>",
projectId: "<YOUR_PROJECT_ID>"
});

// Generate a random Firebase location
Expand Down
6 changes: 3 additions & 3 deletions examples/html5Geolocation/js/html5Geolocation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(function() {
// Initialize the Firebase SDK
initializeApp({
apiKey: "AIzaSyCR4ND2xwX3kU1IxTn0youF5OlI3x6MFZs",
databaseURL: "https://geofire-gh-tests.firebaseio.com",
projectId: "geofire-gh-tests"
apiKey: "<YOUR_API_KEY>",
databaseURL: "<YOUR_DB_URL>",
projectId: "<YOUR_PROJECT_ID>"
});

// Generate a random Firebase location
Expand Down
6 changes: 3 additions & 3 deletions examples/queryBuilder/js/queryBuilder.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(function() {
// Initialize the Firebase SDK
initializeApp({
apiKey: "AIzaSyCR4ND2xwX3kU1IxTn0youF5OlI3x6MFZs",
databaseURL: "https://geofire-gh-tests.firebaseio.com",
projectId: "geofire-gh-tests"
apiKey: "<YOUR_API_KEY>",
databaseURL: "<YOUR_DB_URL>",
projectId: "<YOUR_PROJECT_ID>"
});

// Generate a random Firebase location
Expand Down
6 changes: 3 additions & 3 deletions packages/geofire/test/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export let geoFireRef: DatabaseReference,

// Initialize Firebase
const config = {
apiKey: 'AIzaSyCR4ND2xwX3kU1IxTn0youF5OlI3x6MFZs',
databaseURL: 'https://geofire-gh-tests.firebaseio.com',
projectId: 'geofire-gh-tests'
apiKey: '<YOUR_API_KEY>',
databaseURL: 'https://fake-project-id.firebaseio.com',
projectId: 'fake-project-id'
};
initializeApp(config);

Expand Down
Loading