"use strict";

var _index = require("../../index");

describe('replacing schema value by customOptions from string to other data types', () => {
  const schema = {
    firstData: 'helloBuddy'
  };
  const processEnv = {};
  it('to number', () => {
    const customOptions = {
      firstData: 28
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: 28
    });
  });
  it('to array', () => {
    const customOptions = {
      firstData: [1, 2, 3]
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: [1, 2, 3]
    });
  });
  it('to object', () => {
    const customOptions = {
      firstData: {
        Good: 'Morning'
      }
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: {
        Good: 'Morning'
      }
    });
  });
  it('to  null', () => {
    const customOptions = {
      firstData: null
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: 'helloBuddy'
    });
  });
  it('to  undefined', () => {
    const customOptions = {
      firstData: undefined
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: 'helloBuddy'
    });
  });
  it('to NaN', () => {
    const customOptions = {
      firstData: NaN
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: 'helloBuddy'
    });
  });
});