npm package diff
Package: @forge/events
Versions: 0.8.38-experimental-10722bc - 0.9.2-next.1
File: package/out/__test__/jobProgress.test.js
Index: package/out/__test__/jobProgress.test.js
===================================================================
--- package/out/__test__/jobProgress.test.js
+++ package/out/__test__/jobProgress.test.js
@@ -18,9 +18,9 @@
}, 200);
const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
const response = await jobProgress.getStats();
const { success, inProgress, failed } = await response.json();
- (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+ (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}', {
queueName: 'test-queue-name',
jobId: 'test-job-id'
});
expect(success).toEqual(100);
@@ -33,18 +33,18 @@
code: 404
}, 404);
const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
await expect(jobProgress.getStats()).rejects.toThrow(new errors_1.JobDoesNotExistError(`The job test-job-id was not found for the queue test-queue-name.`));
- (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+ (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}', {
queueName: 'test-queue-name',
jobId: 'test-job-id'
});
});
it('should throw RateLimitError', async () => {
const apiClientMock = (0, utils_1.getMockFetchMethod)({}, 429);
const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
await expect(jobProgress.getStats()).rejects.toThrow(new errors_1.RateLimitError(`Too many requests.`));
- (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+ (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}', {
queueName: 'test-queue-name',
jobId: 'test-job-id'
});
});
@@ -55,9 +55,9 @@
details: 'The request processing has failed because of an unknown error, exception or failure'
}, 513);
const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
await expect(jobProgress.getStats()).rejects.toThrow(new errors_1.InternalServerError(`513 Status Text: Service is not available`, 513));
- (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+ (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}', {
queueName: 'test-queue-name',
jobId: 'test-job-id'
});
});
@@ -66,9 +66,9 @@
it('should call the queue/cancel endpoint', async () => {
const apiClientMock = (0, utils_1.getMockFetchMethod)({}, 204);
const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
const response = await jobProgress.cancel();
- (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/cancel/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+ (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/cancel/{contextAri}/{environmentId}/{appId}/{appVersion}', {
queueName: 'test-queue-name',
jobId: 'test-job-id'
});
expect(response.status).toEqual(204);
@@ -79,9 +79,9 @@
code: 404
}, 404);
const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
await expect(jobProgress.cancel()).rejects.toThrow(new errors_1.JobDoesNotExistError(`The job test-job-id was not found for the queue test-queue-name.`));
- (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/cancel/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+ (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/cancel/{contextAri}/{environmentId}/{appId}/{appVersion}', {
queueName: 'test-queue-name',
jobId: 'test-job-id'
});
});
@@ -91,9 +91,9 @@
errors: ['jobId must not be null', 'queueName must not be null']
}, 422);
const jobProgress = getJobProgress('test-queue-name#test-job-id', apiClientMock);
await expect(jobProgress.getStats()).rejects.toThrow(new errors_1.InternalServerError(`422 Status Text: jobId must not be null, queueName must not be null`));
- (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{cloudId}/{environmentId}/{appId}/{appVersion}', {
+ (0, utils_1.verifyApiClientCalledWith)(apiClientMock, '/webhook/queue/stats/{contextAri}/{environmentId}/{appId}/{appVersion}', {
queueName: 'test-queue-name',
jobId: 'test-job-id'
});
});