"use strict";

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

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