diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 33fd91e..3b457c4 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -9,14 +9,10 @@ on: pull_request: branches: ["main"] -env: - YOURLS_USERNAME: ${{ vars.YOURLS_USERNAME }} - YOURLS_PASSWORD: ${{vars.YOURLS_PASSWORD}} - YOURLS_SERVER_URL: ${{vars.YOURLS_SERVER_URL}} - jobs: build: runs-on: ubuntu-latest + environment: Test strategy: matrix: @@ -26,6 +22,10 @@ jobs: steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} + env: + YOURLS_USERNAME: ${{ vars.YOURLS_USERNAME }} + YOURLS_PASSWORD: ${{vars.YOURLS_PASSWORD}} + YOURLS_SERVER_URL: ${{vars.YOURLS_SERVER_URL}} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} diff --git a/index.test.ts b/index.test.ts index 996262f..37ad555 100644 --- a/index.test.ts +++ b/index.test.ts @@ -5,9 +5,9 @@ dotenv.config(); test("Should get a unique shorturl without any errors", async () => { const response = await getShortLink({ - username: process.env["YOURLS_USERNAME"]!, - password: process.env["YOURLS_PASSWORD"]!, - serverUrl: process.env["YOURLS_SERVER_URL"]!, + username: process.env["YOURLS_USERNAME"] as string, + password: process.env["YOURLS_PASSWORD"] as string, + serverUrl: process.env["YOURLS_SERVER_URL"] as string, // A uniquely generated url url: `https://example-${Date.now()}.com`, });