From 2904a371b4d026e89f97dcbb2c9659604ed8fea9 Mon Sep 17 00:00:00 2001 From: sebastianMindee Date: Fri, 8 Mar 2024 16:11:30 +0100 Subject: [PATCH] restore former tests + fix async default value --- creates/async.js | 2 +- test/mindee.js | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/creates/async.js b/creates/async.js index 8024bcc..ef37837 100644 --- a/creates/async.js +++ b/creates/async.js @@ -1,6 +1,6 @@ const defaults = require("./defaults"); module.exports = { - enqueueAndParse: async (z, inputDocument, apiOwner, apiName, apiVersion, headers, maxRetries) => { + enqueueAndParse: async (z, inputDocument, apiOwner, apiName, apiVersion, headers, maxRetries=60) => { const enqueueResponse = await z.request({ url: `https://api.mindee.net/v1/products/${apiOwner}/${apiName}/v${apiVersion}/predict_async`, method: 'POST', diff --git a/test/mindee.js b/test/mindee.js index 1b8e69e..3779ca3 100644 --- a/test/mindee.js +++ b/test/mindee.js @@ -5,7 +5,6 @@ */ const zapier = require('zapier-platform-core'); -const {describe, it} = require("mocha"); const App = require('../index.js'); const appTester = zapier.createAppTester(App); @@ -27,7 +26,7 @@ zapier.tools.env.inject(); describe('Create - Mindee_invoice', () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_invoice'].operation.perform, bundle) + appTester(App.creates['Mindee_invoice'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); }) @@ -36,7 +35,7 @@ describe('Create - Mindee_invoice', () => { describe('Create - Mindee_expense_receipt', () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_expense_receipt'].operation.perform, bundle) + appTester(App.creates['Mindee_expense_receipt'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); }) @@ -45,7 +44,7 @@ describe('Create - Mindee_expense_receipt', () => { describe('Create - Mindee_passport', () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_passport'].operation.perform, bundle) + appTester(App.creates['Mindee_passport'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); }) @@ -54,7 +53,7 @@ describe('Create - Mindee_passport', () => { describe('Create - Mindee_idcard_fr', () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_idcard_fr'].operation.perform, bundle) + appTester(App.creates['Mindee_idcard_fr'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); }) @@ -63,7 +62,7 @@ describe('Create - Mindee_idcard_fr', () => { describe('Create - Mindee_financial_document', () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_financial_document'].operation.perform, bundle) + appTester(App.creates['Mindee_financial_document'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); }) @@ -72,7 +71,7 @@ describe('Create - Mindee_financial_document', () => { describe('Create - Mindee_custom_api', () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_custom_api'].operation.perform, bundle) + appTester(App.creates['Mindee_custom_api'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); }) @@ -81,7 +80,7 @@ describe('Create - Mindee_custom_api', () => { describe('Create - Mindee_fr_bank_account_details', () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_fr_bank_account_details'].operation.perform, bundle) + appTester(App.creates['Mindee_fr_bank_account_details'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); }) @@ -90,7 +89,7 @@ describe('Create - Mindee_fr_bank_account_details', () => { describe('Create - Mindee_us_bank_check', () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_us_bank_check'].operation.perform, bundle) + appTester(App.creates['Mindee_us_bank_check'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); }) @@ -99,7 +98,7 @@ describe('Create - Mindee_us_bank_check', () => { describe('Create - Mindee_us_driving_license', async () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_us_driving_license'].operation.perform, bundle) + appTester(App.creates['Mindee_us_driving_license'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); }) @@ -108,7 +107,7 @@ describe('Create - Mindee_us_driving_license', async () => { describe('Create - Mindee_generated_api', () => { it('should create an object', async () => { - await appTester(App.creates['Mindee_generated_api'].operation.perform, bundle) + appTester(App.creates['Mindee_generated_api'].operation.perform, bundle) .then(result => { result.should.not.be.an.Array(); })