Chore/jest

This commit is contained in:
Sofiya Tepikin
2022-08-12 09:31:33 +00:00
parent 0cd2770996
commit a103949f7c
16 changed files with 6978 additions and 912 deletions
+3 -6
View File
@@ -1,7 +1,4 @@
import replaceWithNullIfAllPropertiesAreNull from '../lib/import-export/replace-with-null'
import chai from 'chai'
const expect = chai.expect
describe('replaceWithNullIfAllPropertiesAreNull', () => {
it('when data object has no null values, data object remains unchanged', () => {
@@ -12,7 +9,7 @@ describe('replaceWithNullIfAllPropertiesAreNull', () => {
const obj = { ...initialData }
replaceWithNullIfAllPropertiesAreNull(obj)
expect(obj).to.deep.equal(initialData)
expect(obj).toEqual(initialData)
})
it('when data object has nested object with all values null, nested object is replaced with null', () => {
@@ -24,13 +21,13 @@ describe('replaceWithNullIfAllPropertiesAreNull', () => {
const expectedData = { bleeding: null, date: '2021-10-08' }
replaceWithNullIfAllPropertiesAreNull(obj)
expect(obj).to.deep.equal(expectedData)
expect(obj).toEqual(expectedData)
})
it('when data object is empty, data object remains unchanged', () => {
const obj = {}
replaceWithNullIfAllPropertiesAreNull(obj)
expect(obj).to.deep.equal({})
expect(obj).toEqual({})
})
})