Skip to content

Commit

Permalink
feat(test): cover Actor.runs().list() and Actor.builds().list()
Browse files Browse the repository at this point in the history
  • Loading branch information
foxt451 committed Feb 6, 2024
1 parent 9d54ee1 commit 017bf26
Show file tree
Hide file tree
Showing 5 changed files with 217 additions and 189 deletions.
6 changes: 6 additions & 0 deletions src/apify_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ export class ApifyClient {
});
}

/**
* https://docs.apify.com/api/v2#/reference/actor-builds/build-collection
*/
builds(): BuildCollectionClient {
return new BuildCollectionClient(this._options());
}
Expand Down Expand Up @@ -202,6 +205,9 @@ export class ApifyClient {
return new RequestQueueClient(apiClientOptions, options);
}

/**
* https://docs.apify.com/api/v2#/reference/actor-runs/run-collection
*/
runs(): RunCollectionClient {
return new RunCollectionClient({
...this._options(),
Expand Down
2 changes: 1 addition & 1 deletion test/builds.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Build methods', () => {
});

describe('builds()', () => {
test.skip('list() works', async () => {
test('list() works', async () => {
const query = {
limit: 5,
offset: 3,
Expand Down
1 change: 1 addition & 0 deletions test/mock_server/routes/builds.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { addRoutes } = require('./add_routes');
const builds = express.Router();

const ROUTES = [
{ id: 'list-builds', method: 'GET', path: '/' },
{ id: 'get-build', method: 'GET', path: '/:buildId', type: 'responseJsonMock' },
{ id: 'abort-build', method: 'POST', path: '/:buildId/abort' },
];
Expand Down
1 change: 1 addition & 0 deletions test/mock_server/routes/runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { addRoutes } = require('./add_routes');
const runs = express.Router();

const ROUTES = [
{ id: 'list-runs', method: 'GET', path: '/' },
{ id: 'get-run', method: 'GET', path: '/:runId', type: 'responseJsonMock' },
{ id: 'abort-run', method: 'POST', path: '/:runId/abort' },
{ id: 'metamorph-run', method: 'POST', path: '/:runId/metamorph' },
Expand Down
Loading

0 comments on commit 017bf26

Please sign in to comment.