andreirk/project-lvl2-s341

View on GitHub
__tests__/half.test.js

Summary

Maintainability
A
0 mins
Test Coverage
import genDiff from '../src/bin/gendiff';

const beforeJson = {
  host: 'hexlet.io',
  timeout: 50,
  proxy: '123.234.53.22',
  follow: false,
};

const afterJson = {
  timeout: 20,
  verbose: true,
  host: 'hexlet.io',
};

const espectedDiff = `{
  - follow: false
    host: hexlet.io
  - proxy: 123.234.53.22
  - timeout: 50
  + timeout: 20
  + verbose: true
}`;

test('diff ', () => {
  const diff = genDiff(beforeJson, afterJson);
  expect(diff).toBe(espectedDiff);
});