Skip to content

Commit

Permalink
fix: fix specs timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
pviti committed Nov 22, 2023
1 parent 1ffcded commit 1f77c46
Show file tree
Hide file tree
Showing 105 changed files with 108 additions and 104 deletions.
4 changes: 4 additions & 0 deletions gen/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ const generate = async () => {
const actionTpl = readTemplate('action')
const specTpl = readTemplate('spec')


const specTimeout = 1000 * Object.keys(generatedTriggers).length

Object.entries(generatedTriggers).forEach(([resource, triggers]) => {

const resType = Inflector.pluralize(resource)
Expand Down Expand Up @@ -164,6 +167,7 @@ const generate = async () => {

let spec = specTpl.replace(/##__ACTION_ID__##/g, action)
spec = spec.replace(/##__RESOURCE_TYPE__##/g, resType)
spec = spec.replace(/##__SPEC_TIMEOUT__##/g, String(specTimeout))
const specName = fileName.replace(/.ts/g, '.test.ts')
fs.writeFileSync(join(spcDir, specName), spec)
console.log(`Created spec: ${action} [${specName}]`)
Expand Down
2 changes: 1 addition & 1 deletion gen/templates/spec.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('##__RESOURCE_TYPE__##:##__ACTION_ID__##', () => {
test
.timeout(15000)
.timeout(##__SPEC_TIMEOUT__##)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/adyen_payment/details.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('adyen_payments:details', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/authorization/capture.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('authorizations:capture', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('authorizations:capture_amount_cents', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/authorization/void.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('authorizations:void', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/axerve_payment/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('axerve_payments:update', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/bundle/compute_compare_at_amount.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('bundles:compute_compare_at_amount', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/bundle/compute_price_amount.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('bundles:compute_price_amount', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/buy_x_pay_y_promotion/disable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('buy_x_pay_y_promotions:disable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/buy_x_pay_y_promotion/enable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('buy_x_pay_y_promotions:enable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/capture/refund.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('captures:refund', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/capture/refund_amount_ce.test.ts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('captures:refund_amount_cents', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/checkout_com_payment/details.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('checkout_com_payments:details', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/checkout_com_payment/refresh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('checkout_com_payments:refresh', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('customer_password_resets:reset_password_token', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/external_promotion/disable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('external_promotions:disable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/external_promotion/enable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('external_promotions:enable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/fixed_amount_promotion/disable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('fixed_amount_promotions:disable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/fixed_amount_promotion/enable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('fixed_amount_promotions:enable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/fixed_price_promotion/disable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('fixed_price_promotions:disable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/fixed_price_promotion/enable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('fixed_price_promotions:enable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/free_gift_promotion/disable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('free_gift_promotions:disable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/free_gift_promotion/enable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('free_gift_promotions:enable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/free_shipping_promotion/disable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('free_shipping_promotions:disable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/free_shipping_promotion/enable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('free_shipping_promotions:enable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/gift_card/activate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('gift_cards:activate', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/gift_card/balance_change_ce.test.ts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('gift_cards:balance_change_cents', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/gift_card/deactivate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('gift_cards:deactivate', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/gift_card/purchase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('gift_cards:purchase', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/in_stock_subscription/activate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('in_stock_subscriptions:activate', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/in_stock_subscription/deactivate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('in_stock_subscriptions:deactivate', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/klarna_payment/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('klarna_payments:update', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/line_item/external_price.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('line_items:external_price', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/line_item/reserve_stock.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('line_items:reserve_stock', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/market/disable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('markets:disable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/market/enable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('markets:enable', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/order/approve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('orders:approve', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/order/approve_and_capture.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('orders:approve_and_capture', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/order/archive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('orders:archive', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('orders:authorization_amount_cents', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/order/authorize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('orders:authorize', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/order/billing_address_clone_id.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@oclif/test'

describe('orders:billing_address_clone_id', () => {
test
.timeout(15000)
.timeout(31000)
.stdout()
.command(['noc'])
.it('runs NoC', ctx => {
Expand Down
Loading

0 comments on commit 1f77c46

Please sign in to comment.