Skip to content

Commit

Permalink
Add environment variable TEST_KEY to node.js.yml and print its value …
Browse files Browse the repository at this point in the history
…in test.ts

Generated by gpt-3.5-turbo
  • Loading branch information
joone committed Feb 1, 2024
1 parent 82dec4b commit bd5fdb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
TEST_KEY: ${{ secrets.TEST_KEY }}
- run: npm ci
- run: npm run build --if-present
- run: npm test -- --grep=Loz.init
1 change: 1 addition & 0 deletions tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "mocha";

describe("Loz.init", () => {
before(() => {
console.log("TEST_KEY: " + process.env.TEST_KEY);
if (!process.env.OPENAI_API_KEY) {
throw new Error("API_KEY environment variable is not set.");
}
Expand Down

0 comments on commit bd5fdb3

Please sign in to comment.