Skip to content

Commit

Permalink
Added logs when parsing .env in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kober32 committed Sep 9, 2024
1 parent 2626047 commit 86c3423
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
- name: Set .env file
env:
ENV_TEST_FILE: ${{ secrets.ENV_TEST_FILE }}
run: echo $ENV_TEST_FILE > testapp/.env
run: echo "$ENV_TEST_FILE" > testapp/.env
- name: Run iOS Tests
run: npm run buildAndRunCordovaIosTests
7 changes: 4 additions & 3 deletions testapp-cordova/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ class Platform {
`

// parse environment configuration
const getEnvConfig = dotenv.parse(fs.readFileSync(`${rnTestAppDir}/.env`))
const envConfig = `const EnvConfig = ${JSON.stringify(getEnvConfig)};`
const envConfig = dotenv.parse(fs.readFileSync(`${rnTestAppDir}/.env`))
console.log(`Reading env config env with pa server ${envConfig.POWERAUTH_SERVER_URL} and enrollment server ${envConfig.ENROLLMENT_SERVER_URL}`)
const envConfigStr = `const EnvConfig = ${JSON.stringify(envConfig)};`

const copyTestFiles = () =>
gulp
.src([`${rnTestAppDir}/src/testbed/**/**.ts`, `${rnTestAppDir}/src/Config.ts`, `${rnTestAppDir}/_tests/**/**.ts`], { base: rnTestAppDir })
.pipe(replace(/import {[a-zA-Z }\n,]+from "react-native-powerauth-mobile-sdk";/g, ''))
.pipe(replace('import { Platform } from "react-native";', platformClass))
.pipe(replace('import { Config as EnvConfig } from "react-native-config";', envConfig))
.pipe(replace('import { Config as EnvConfig } from "react-native-config";', envConfigStr))
.pipe(gulp.dest(tempDir));

const copyAppFiles = () =>
Expand Down

0 comments on commit 86c3423

Please sign in to comment.