Skip to content

Commit

Permalink
Remove IAP environment dependencies from tests
Browse files Browse the repository at this point in the history
This commit removes IAP environment dependencies from tests, to ensure
that anyone can run tests even with no environment setup.

Testing: Moved `.env` file elsewhere to simulate a fresh environment. Ran tests and ensured they are passing.
Closes: damus-io/damus#2034
Signed-off-by: Daniel D’Aquino <[email protected]>
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
danieldaquino authored and jb55 committed Mar 7, 2024
1 parent 951c46d commit 390a05c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ result-4

# App Store private keys
*.p8
apple-root-ca

# macOS Finder
.DS_Store
Binary file added apple-root-ca/AppleComputerRootCertificate.cer
Binary file not shown.
Binary file added apple-root-ca/AppleIncRootCertificate.cer
Binary file not shown.
Binary file added apple-root-ca/AppleRootCA-G2.cer
Binary file not shown.
Binary file added apple-root-ca/AppleRootCA-G3.cer
Binary file not shown.
7 changes: 7 additions & 0 deletions test/controllers/purple_test_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ class PurpleTestController {
process.env.DEEPL_KEY = 'deepl_key'
process.env.ENABLE_HTTP_AUTH = 'true' // Enable HTTP auth for tests
process.env.LN_INVOICE_CHECK_TIMEOUT_MS = '5000'
process.env.ENABLE_IAP_PAYMENTS = "true"
process.env.MOCK_VERIFY_RECEIPT = false
process.env.IAP_ISSUER_ID = "MOCK"
process.env.IAP_KEY_ID = "MOCK"
process.env.IAP_BUNDLE_ID = "com.jb55.damus2"
process.env.IAP_PRIVATE_KEY_PATH = "./test_utils/mock.p8"
process.env.IAP_ENVIRONMENT = "Sandbox"
}

setup_stubs() {
Expand Down
Empty file added test_utils/mock.p8
Empty file.

0 comments on commit 390a05c

Please sign in to comment.