How to use the zapier-platform-core.createAppTester function in zapier-platform-core

To help you get started, we’ve selected a few zapier-platform-core 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 zapier / zapier-platform-example-app-github / test / authentication.js View on Github external
'use strict';
const should = require('should');

const zapier = require('zapier-platform-core');

const App = require('../index');
const appTester = zapier.createAppTester(App);


describe('basic authentication', () => {
  // Put your test TEST_USERNAME and TEST_PASSWORD in a .env file.
  // The inject method will load them and make them available to use in your
  // tests.
  zapier.tools.env.inject();

  it('should authenticate', (done) => {
    const bundle = {
      authData: {
        username: process.env.TEST_USERNAME,
        password: process.env.TEST_PASSWORD
      }
    };
github cloudblue / connect-fulfillment-zapier-app / test / triggers / fulfillment_parameters.js View on Github external
/* globals describe it */
const should = require('should');
const sinon = require('sinon');
const zapier = require('zapier-platform-core');
const { ProductService } = require('@cloudblueconnect/connect-javascript-sdk/lib/connect/api');
// Use this to make test calls into your app:
const App = require('../../index');
const appTester = zapier.createAppTester(App);
zapier.tools.env.inject();

const responses = require('../responses');

describe('Connect Fulfillment Zapier App - Fulfillment parameters', () => {
  let sandbox;
  before(() => { sandbox = sinon.createSandbox(); });
  afterEach(done => { sandbox.restore(); done(); });
  it('should return a list of parameters with scope=asset and phase=fulfillment', done => {
    const bundle = {
      authData: {
        api_key: process.env.CONNECT_API_KEY,
        endpoint: process.env.CONNECT_ENDPOINT
      },
      inputData: {
          id: 'PRD-000-000-000'
github cloudblue / connect-fulfillment-zapier-app / test / creates / reject_request.js View on Github external
/**
 * This file is part of the Ingram Micro Cloud Blue Connect SDK.
 *
 * @copyright (c) 2019. Ingram Micro. All Rights Reserved.
 */

const should = require('should');
const { Fulfillment } = require('@cloudblueconnect/connect-javascript-sdk');
const sinon = require('sinon');
const zapier = require('zapier-platform-core');
const responses = require('../responses');

// Use this to make test calls into your app:
const App = require('../../index');
const appTester = zapier.createAppTester(App);
zapier.tools.env.inject();

describe('Connect Fulfillment Zapier App - Reject Request', () => {
  let sandbox;
  before(() => { sandbox = sinon.createSandbox(); });
  afterEach(done => { sandbox.restore(); done(); });
  it('should return a payload of the rejected request', done => {
    const bundle = {
      authData: {
        api_key: process.env.CONNECT_API_KEY,
        endpoint: process.env.CONNECT_ENDPOINT
      },
      inputData: {
        request_id: 'PR-5426-PR-5426-9883-2189-001',
        reason: 'Not available'
      }
github cloudblue / connect-fulfillment-zapier-app / test / searches / search_requests.js View on Github external
* This file is part of the Ingram Micro Cloud Blue Connect SDK.
 *
 * @copyright (c) 2019. Ingram Micro. All Rights Reserved.
 */

/* globals describe it */
const should = require('should');
const sinon = require('sinon');
const zapier = require('zapier-platform-core');
const { Fulfillment } = require('@cloudblueconnect/connect-javascript-sdk');
const BaseResource = require('@cloudblueconnect/connect-javascript-sdk/lib/connect/api/base');
const { RequestResource } = require('@cloudblueconnect/connect-javascript-sdk/lib/connect/api');

// Use this to make test calls into your app:
const App = require('../../index');
const appTester = zapier.createAppTester(App);
zapier.tools.env.inject();

const responses = require('../responses');


describe('Connect Fulfillment Zapier App - Search Requests', () => {
  let sandbox;
  before(() => { sandbox = sinon.createSandbox(); });
  afterEach(done => { sandbox.restore(); done(); });
  it('should return a list of requests filtered by status', done => {
    const bundle = {
      authData: {
        api_key: process.env.CONNECT_API_KEY,
        endpoint: process.env.CONNECT_ENDPOINT
      },
      inputData: {
github cloudblue / connect-fulfillment-zapier-app / test / triggers / hubs.js View on Github external
/**
 * This file is part of the Ingram Micro Cloud Blue Connect SDK.
 *
 * @copyright (c) 2019. Ingram Micro. All Rights Reserved.
 */

/* globals describe it */
const should = require('should');
const sinon = require('sinon');
const zapier = require('zapier-platform-core');
const { HubResource } = require('@cloudblueconnect/connect-javascript-sdk/lib/connect/api');

// Use this to make test calls into your app:
const App = require('../../index');
const appTester = zapier.createAppTester(App);
zapier.tools.env.inject();

const responses = require('../responses');


describe('Connect Fulfillment Zapier App - List hubs', () => {
  let sandbox;
  before(() => { sandbox = sinon.createSandbox(); });
  afterEach(done => { sandbox.restore(); done(); });
  it('should return a list of hubs', done => {
    const bundle = {
      authData: {
        api_key: process.env.CONNECT_API_KEY,
        endpoint: process.env.CONNECT_ENDPOINT
      },
      inputData: {}
github mautic / mautic-zapier / test / triggers / contactCreated.js View on Github external
const should = require('should');

const zapier = require('zapier-platform-core');

const App = require('../../index');
const appTester = zapier.createAppTester(App);

describe('contact triggers', () => {

  describe('new contact created trigger', () => {

    var subscribeData = null;

    it('should create a contact create hook', (done) => {
      zapier.tools.env.inject();
      const bundle = {
        targetUrl: 'http://provided.by?zapier',
        authData: {
          baseUrl: process.env.TEST_BASE_URL,
          username: process.env.TEST_BASIC_AUTH_USERNAME,
          password: process.env.TEST_BASIC_AUTH_PASSWORD
        }
github mautic / mautic-zapier / test / triggers / formSubmitted.js View on Github external
const should = require('should');

const zapier = require('zapier-platform-core');

const App = require('../../index');
const appTester = zapier.createAppTester(App);

describe('form triggers', () => {

  describe('new form submission trigger', () => {

    var subscribeData = null;

    it('should create a form submitted hook', (done) => {
      zapier.tools.env.inject();
      const bundle = {
        targetUrl: 'http://provided.by?zapier',
        authData: {
          baseUrl: process.env.TEST_BASE_URL,
          username: process.env.TEST_BASIC_AUTH_USERNAME,
          password: process.env.TEST_BASIC_AUTH_PASSWORD
        }
github zapier / zapier-platform-example-app-rest-hooks / test / triggers.js View on Github external
require('should');

const zapier = require('zapier-platform-core');

const App = require('../index');
const appTester = zapier.createAppTester(App);

describe('triggers', () => {

  describe('new recipe trigger', () => {
    it('should load recipe from fake hook', (done) => {
      const bundle = {
        inputData: {
          style: 'mediterranean'
        },
        cleanedRequest: {
          id: 1,
          name: 'name 1',
          directions: 'directions 1'
        }
      };
github mautic / mautic-zapier / test / triggers / contactUpdated.js View on Github external
const should = require('should');

const zapier = require('zapier-platform-core');

const App = require('../../index');
const appTester = zapier.createAppTester(App);

describe('contact triggers', () => {

  describe('new contact updated trigger', () => {

    var subscribeData = null;

    it('should create a contact update hook', (done) => {
      zapier.tools.env.inject();
      const bundle = {
        targetUrl: 'http://provided.by?zapier',
        authData: {
          baseUrl: process.env.TEST_BASE_URL,
          username: process.env.TEST_BASIC_AUTH_USERNAME,
          password: process.env.TEST_BASIC_AUTH_PASSWORD
        }
github DefinitelyTyped / DefinitelyTyped / types / zapier-platform-core / zapier-platform-core-tests.ts View on Github external
const testCreateAppTester = async () => {
    const zapierApp = {};
    const appTester = await zapier.createAppTester(zapierApp);
};

zapier-platform-core

The core SDK for CLI apps in the Zapier Developer Platform.

SEE LICENSE IN LICENSE
Latest version published 21 days ago

Package Health Score

87 / 100
Full package analysis

Similar packages