"use strict";

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

describe('replacing schema value by customOptions from object cannot have cli as a key to other data types when schema does not have the cli as a key', () => {
  const schema = {
    firstData: {
      hello: 'Buddy'
    }
  };
  const processEnv = {};
  it('to number', () => {
    const customOptions = {
      firstData: 28
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: {
        hello: 'Buddy'
      }
    });
  });
  it('to string', () => {
    const customOptions = {
      firstData: 'hi'
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: {
        hello: 'Buddy'
      }
    });
  });
  it('to array', () => {
    const customOptions = {
      firstData: [1, 2, 3, 'hi']
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: {
        hello: 'Buddy'
      }
    });
  });
  it('to  null', () => {
    const customOptions = {
      firstData: null
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: {
        hello: 'Buddy'
      }
    });
  });
  it('to  undefined', () => {
    const customOptions = {
      firstData: undefined
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: {
        hello: 'Buddy'
      }
    });
  });
  it('to NaN', () => {
    const customOptions = {
      firstData: NaN
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: {
        hello: 'Buddy'
      }
    });
  });
});
describe('replacing schema value by customOptions from object with cli as a key to other data types when schema does not have the cli as a key', () => {
  const schema = {
    firstData: {
      cli: 'first',
      value: 'js'
    }
  };
  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 array', () => {
    const customOptions = {
      firstData: [1, 2, 3, 'hi']
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: [1, 2, 3, 'hi']
    });
  });
  it('to  null', () => {
    const customOptions = {
      firstData: null
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: 'js'
    });
  });
  it('to  undefined', () => {
    const customOptions = {
      firstData: undefined
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: 'js'
    });
  });
  it('to NaN', () => {
    const customOptions = {
      firstData: NaN
    };
    const output = (0, _index.applyValuesToSchema)(schema, customOptions, processEnv);
    expect(output).toStrictEqual({
      firstData: 'js'
    });
  });
});