Skip to content

Commit 017bf26

Browse files
committed
feat(test): cover Actor.runs().list() and Actor.builds().list()
1 parent 9d54ee1 commit 017bf26

File tree

5 files changed

+217
-189
lines changed

5 files changed

+217
-189
lines changed

src/apify_client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ export class ApifyClient {
110110
});
111111
}
112112

113+
/**
114+
* https://docs.apify.com/api/v2#/reference/actor-builds/build-collection
115+
*/
113116
builds(): BuildCollectionClient {
114117
return new BuildCollectionClient(this._options());
115118
}
@@ -202,6 +205,9 @@ export class ApifyClient {
202205
return new RequestQueueClient(apiClientOptions, options);
203206
}
204207

208+
/**
209+
* https://docs.apify.com/api/v2#/reference/actor-runs/run-collection
210+
*/
205211
runs(): RunCollectionClient {
206212
return new RunCollectionClient({
207213
...this._options(),

test/builds.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Build methods', () => {
3535
});
3636

3737
describe('builds()', () => {
38-
test.skip('list() works', async () => {
38+
test('list() works', async () => {
3939
const query = {
4040
limit: 5,
4141
offset: 3,

test/mock_server/routes/builds.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const { addRoutes } = require('./add_routes');
44
const builds = express.Router();
55

66
const ROUTES = [
7+
{ id: 'list-builds', method: 'GET', path: '/' },
78
{ id: 'get-build', method: 'GET', path: '/:buildId', type: 'responseJsonMock' },
89
{ id: 'abort-build', method: 'POST', path: '/:buildId/abort' },
910
];

test/mock_server/routes/runs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const { addRoutes } = require('./add_routes');
44
const runs = express.Router();
55

66
const ROUTES = [
7+
{ id: 'list-runs', method: 'GET', path: '/' },
78
{ id: 'get-run', method: 'GET', path: '/:runId', type: 'responseJsonMock' },
89
{ id: 'abort-run', method: 'POST', path: '/:runId/abort' },
910
{ id: 'metamorph-run', method: 'POST', path: '/:runId/metamorph' },

0 commit comments

Comments
 (0)