npm package diff
Package: @forge/events
Versions: 2.0.1-next.0 - 2.0.1-next.1
File: package/out/__test__/invocationError.test.js
Index: package/out/__test__/invocationError.test.js
===================================================================
--- package/out/__test__/invocationError.test.js
+++ package/out/__test__/invocationError.test.js
@@ -1,36 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const invocationError_1 = require("../invocationError");
-const invocationErrorCode_1 = require("../invocationErrorCode");
-const retryOptions_1 = require("../retryOptions");
-describe('InvocationError tests', () => {
- let target = new invocationError_1.InvocationError();
- it('Populate invocationError with default retryOptions and expect default retry option', async () => {
- expect(target.retryOptions.retryAfter).toEqual(retryOptions_1.DEFAULT_RETRY_OPTIONS.retryAfter);
- expect(target.retryOptions.retryReason).toEqual(invocationErrorCode_1.InvocationErrorCode.FUNCTION_RETRY_REQUEST);
- expect(target.hasOwnProperty('_retry')).toBe(true);
- });
- it('Populate InvocationError with custom RetryOptions and expect the custom value to set.', () => {
- const retryOptions = {
- retryAfter: 10,
- retryReason: invocationErrorCode_1.InvocationErrorCode.FUNCTION_OUT_OF_MEMORY,
- retryData: {
- eventsToSplit: 5
- }
- };
- target = new invocationError_1.InvocationError(retryOptions);
- expect(target.retryOptions).toEqual(retryOptions);
- expect(target.hasOwnProperty('_retry')).toBe(true);
- });
- it('Use MIN_RETRY_AFTER when retryAfter <= 0', () => {
- const retryOptions = {
- retryAfter: 0,
- retryReason: invocationErrorCode_1.InvocationErrorCode.FUNCTION_OUT_OF_MEMORY,
- retryData: 'some string data'
- };
- target = new invocationError_1.InvocationError(retryOptions);
- expect(target.retryOptions.retryAfter).toEqual(retryOptions_1.MIN_RETRY_AFTER);
- expect(target.retryOptions.retryData).toEqual('some string data');
- expect(target.hasOwnProperty('_retry')).toBe(true);
- });
-});