Skip to content

Commit

Permalink
chore: fixed tets issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dackers86 committed Aug 15, 2023
1 parent 34fd315 commit 8328ec4
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 6 deletions.
66 changes: 66 additions & 0 deletions firestore-stripe-payments/_emulator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log*
firebase-debug.*.log*

# Firebase cache
.firebase/

# Firebase config

# Uncomment this if you'd like others to create their own Firebase project.
# For a team working on the same Firebase project(s), it is recommended to leave
# it commented so all members can deploy to the same project(s) in .firebaserc.
# .firebaserc

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
STRIPE_API_KEY=
STRIPE_API_KEY=
17 changes: 16 additions & 1 deletion firestore-stripe-payments/_emulator/firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"hub": {
"port": 4000
},
"firestore": {
"port": 8080
},
"storage": {
"port": 9199
},
Expand All @@ -25,5 +28,17 @@
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
}
},
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
]
}
]
}
1 change: 1 addition & 0 deletions firestore-stripe-payments/_emulator/functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
19 changes: 19 additions & 0 deletions firestore-stripe-payments/_emulator/functions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Import function triggers from their respective submodules:
*
* const {onCall} = require("firebase-functions/v2/https");
* const {onDocumentWritten} = require("firebase-functions/v2/firestore");
*
* See a full list of supported triggers at https://firebase.google.com/docs/functions
*/

const {onRequest} = require("firebase-functions/v2/https");
const logger = require("firebase-functions/logger");

// Create and deploy your first functions
// https://firebase.google.com/docs/functions/get-started

// exports.helloWorld = onRequest((request, response) => {
// logger.info("Hello logs!", {structuredData: true});
// response.send("Hello from Firebase!");
// });
23 changes: 23 additions & 0 deletions firestore-stripe-payments/_emulator/functions/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "18"
},
"main": "index.js",
"dependencies": {
"firebase-admin": "^11.8.0",
"firebase-functions": "^4.3.1"
},
"devDependencies": {
"firebase-functions-test": "^3.1.0"
},
"private": true
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default () => {
process.env.FIRESTORE_EMULATOR_HOST = 'localhost:8080';
process.env.FIREBASE_FIRESTORE_EMULATOR_ADDRESS = 'localhost:8080';
process.env.FIREBASE_AUTH_EMULATOR_HOST = 'localhost:9099';
process.env.FIRESTORE_EMULATOR_HOST = '127.0.0.1:8080';
process.env.FIREBASE_FIRESTORE_EMULATOR_ADDRESS = '127.0.0.1:8080';
process.env.FIREBASE_AUTH_EMULATOR_HOST = '127.0.0.1:9099';
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const createRandomSubscription = async (
card: {
number: '4242424242424242',
exp_month: 5,
exp_year: 2023,
exp_year: new Date().getFullYear() + 1,
cvc: '314',
},
});
Expand Down

0 comments on commit 8328ec4

Please sign in to comment.