diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 468041b..98180c1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,7 +16,7 @@ on: jobs: release-action: runs-on: ubuntu-latest - name: release-it + name: release steps: - name: checkout uses: actions/checkout@v3 @@ -36,6 +36,7 @@ jobs: run: yarn test env: TRANSITLAND_API_KEY: ${{ secrets.TRANSITLAND_API_KEY }} + TRANSITLAND_URL: ${{ secrets.TRANSITLAND_URL }} - id: changes name: detect changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1027f50..1b5a95a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,7 +6,7 @@ on: jobs: test-action: runs-on: ubuntu-latest - name: release-it + name: test steps: - name: checkout uses: actions/checkout@v3 @@ -24,3 +24,4 @@ jobs: run: yarn test env: TRANSITLAND_API_KEY: ${{ secrets.TRANSITLAND_API_KEY }} + TRANSITLAND_URL: ${{ secrets.TRANSITLAND_URL }} diff --git a/README.md b/README.md index 1ca5071..2c54c4f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ![npm](https://img.shields.io/npm/dm/transitland-gql-client) ![GitHub](https://img.shields.io/github/license/boredland/transitland-gql-client) +[![test](https://github.com/boredland/transitland-gql-client/actions/workflows/test.yaml/badge.svg)](https://github.com/boredland/transitland-gql-client/actions/workflows/test.yaml) [![release](https://github.com/boredland/transitland-gql-client/actions/workflows/release.yaml/badge.svg)](https://github.com/boredland/transitland-gql-client/actions/workflows/release.yaml) ## About diff --git a/src/smoke.test.ts b/src/smoke.test.ts index d7e7227..b3e59c5 100644 --- a/src/smoke.test.ts +++ b/src/smoke.test.ts @@ -1,25 +1,24 @@ import { createClient } from "../dist"; -const apiKey = process.env.TRANSITLAND_API_KEY! - it('needs TRANSITLAND_API_KEY to be set', () => { - expect(apiKey).not.toBeUndefined() - expect(apiKey).not.toBeNull() - expect(apiKey).not.toBe("") + expect(process.env.TRANSITLAND_API_KEY).not.toBeUndefined() + expect(process.env.TRANSITLAND_API_KEY).not.toBeNull() + expect(process.env.TRANSITLAND_API_KEY).not.toBe("") }); -it('should have not mutations', () => { - const transitlandClient = createClient({ - apiKey: "yolo", - }); +const transitlandClient = createClient({ + apiKey: process.env.TRANSITLAND_API_KEY!, + url: process.env.TRANSITLAND_URL, + headers: { + Referer: 'https://www.transit.land/', + }, +}); + +it('should have no mutations', () => { expect(transitlandClient).not.toHaveProperty('mutation') }) it("can fetch feeds", async () => { - const transitlandClient = createClient({ - apiKey, - }); - const result = await transitlandClient.query({ feeds: [ {