Skip to content

Commit d92acb0

Browse files
committed
ci: run tests
1 parent 921eeef commit d92acb0

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

.github/workflows/docs.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on:
33
push:
44
branches:
55
- main
6-
- develop
76
paths:
87
- docs/**
98

.github/workflows/test.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- "docs/**"
8+
- "**/*.md"
9+
pull_request:
10+
paths-ignore:
11+
- "docs/**"
12+
- "**/*.md"
13+
14+
jobs:
15+
test:
16+
name: Test
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: "lts/*"
27+
- name: Install dependencies
28+
run: npm ci
29+
- name: Test
30+
run: npm run test
31+
env:
32+
API_KEY: ${{ secrets.API_KEY }}
33+
API_URL: ${{ secrets.API_URL }}
34+
- name: Build
35+
run: npm run build

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"clean": "bsm",
2020
"format": "bsm",
2121
"lint": "bsm",
22+
"test": "bsm test.coverage",
2223
"semantic-release": "semantic-release"
2324
},
2425
"types": "lib/index.d.ts",

test/PaginatedResponse.spec.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ describe("next()", function () {
5454

5555
it("should return null if there is no next page", async function () {
5656
// arrange
57-
const pag = await client.getTemplates({
57+
const paginated = await client.getTemplates({
5858
limit: 1,
59-
page: paginated.meta.pages,
59+
filter: {
60+
name: "this template does not exist",
61+
},
6062
});
6163

6264
// act
63-
const nextNext = await pag?.next();
65+
const nextNext = await paginated?.next();
6466

6567
// assert
6668
expect(nextNext?.meta.pages).toEqual(undefined);

0 commit comments

Comments
 (0)