"use strict";

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

describe('replacing schema value by customOptions from array to other data types', () => {
  const schema = {
    firstData: [1, 2, 3, 'hi']
  };
  const processEnv = {};
  it('to number', () => {
    const customOptions = {
      firstData: 28
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: 28
    });
  });
  it('to string', () => {
    const customOptions = {
      firstData: 'hi'
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: 'hi'
    });
  });
  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: [1, 2, 3, 'hi']
    });
  });
  it('to  undefined', () => {
    const customOptions = {
      firstData: undefined
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: [1, 2, 3, 'hi']
    });
  });
  it('to NaN', () => {
    const customOptions = {
      firstData: NaN
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: [1, 2, 3, 'hi']
    });
  });
});