Skip to content

Commit

Permalink
ci: run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderKoen committed Nov 29, 2023
1 parent 921eeef commit d92acb0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
- develop
paths:
- docs/**

Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "**/*.md"
pull_request:
paths-ignore:
- "docs/**"
- "**/*.md"

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test
env:
API_KEY: ${{ secrets.API_KEY }}
API_URL: ${{ secrets.API_URL }}
- name: Build
run: npm run build
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"clean": "bsm",
"format": "bsm",
"lint": "bsm",
"test": "bsm test.coverage",
"semantic-release": "semantic-release"
},
"types": "lib/index.d.ts",
Expand Down
8 changes: 5 additions & 3 deletions test/PaginatedResponse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ describe("next()", function () {

it("should return null if there is no next page", async function () {
// arrange
const pag = await client.getTemplates({
const paginated = await client.getTemplates({
limit: 1,
page: paginated.meta.pages,
filter: {
name: "this template does not exist",
},
});

// act
const nextNext = await pag?.next();
const nextNext = await paginated?.next();

// assert
expect(nextNext?.meta.pages).toEqual(undefined);
Expand Down

0 comments on commit d92acb0

Please sign in to comment.