How to use the testdouble/dist/testdouble.verify function in testdouble

To help you get started, we’ve selected a few testdouble examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paypal / paypal-card-components / test / contingency-flow.js View on Github external
it('renders a zoid component', () => {
    contingencyFlow.start('https://example.com?cart_id=abc123&action=action&xcomponent=1&flow=contingency');

    td.verify(fakeContingencyInit({
      action:              'action',
      xcomponent:           '1',
      flow:                'contingency',
      cart_id:             'abc123',
      onContingencyResult: td.matchers.isA(Function),
      onError:             td.matchers.isA(Function)
    }));

    td.verify(fakeContingencyComponentRender(document.body));
  });
github paypal / paypal-card-components / test / component.js View on Github external
return HostedFields.render(renderOptions, '#button2').then((handler) => {
      td.replace(handler, 'submit');
      td.when(handler.submit()).thenResolve();
      btn.click();
      td.verify(handler.submit());
    });
  });
github paypal / paypal-card-components / test / component.js View on Github external
return HostedFields.render(renderOptions, '#button2').then(() => {
      td.verify(btn.addEventListener('click', td.matchers.isA(Function)));
    });
  });
github paypal / paypal-card-components / test / happy.js View on Github external
return client.HostedFields.render(renderOptions).then(() => {
            td.verify(btClientCreate({
                authorization: 'PROD',
                configuration: td.matchers.isA(Object)
            }));
            td.verify(hostedFieldsCreate({
                client:      fakeBtClient,
                paymentsSdk: true
            }));
        });
    });
github paypal / paypal-card-components / test / component.js View on Github external
return HostedFields.render(renderOptions, '#button').then(rejectIfResolves).catch((err) => {
      td.verify(hostedFieldsCreate(td.matchers.anything()), {
        times: 0
      });

      assert.equal(err, error);
    });
  });
github paypal / paypal-card-components / test / happy.js View on Github external
}).then(() => {
            td.verify(fakeHostedFieldsInstance.tokenize({
                orderId: 'order-id'
            }));
        });
    });
github paypal / paypal-card-components / test / component.js View on Github external
}).then(() => {
      td.verify(fakeHostedFieldsInstance.tokenize({
        orderId:        'order-id',
        billingAddress: {
          postalCode: '60654'
        }
      }));
    });
  });
github paypal / paypal-card-components / test / component.js View on Github external
setTimeout(() => {
        td.verify(renderOptions.onApprove(tokenizationData));
        done();
      }, 100);
    }).catch(done);
github paypal / paypal-card-components / test / component.js View on Github external
setTimeout(() => {
        td.verify(renderOptions.onError(error));
        done();
      }, 100);
    }).catch(done);