Skip to content

Commit

Permalink
restore former tests + fix async default value
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee committed Mar 8, 2024
1 parent 0203cab commit 2904a37
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion creates/async.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
21 changes: 10 additions & 11 deletions test/mindee.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
})
Expand All @@ -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();
})
Expand All @@ -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();
})
Expand All @@ -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();
})
Expand All @@ -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();
})
Expand All @@ -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();
})
Expand All @@ -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();
})
Expand All @@ -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();
})
Expand All @@ -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();
})
Expand All @@ -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();
})
Expand Down

0 comments on commit 2904a37

Please sign in to comment.