1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-08 13:00:05 +00:00

fix: replace isValidJson with getValidJson

This commit is contained in:
2021-07-18 23:24:22 +05:00
parent 7ac7c5e52b
commit 5347aeba09
6 changed files with 14 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
import { isValidJson } from '../../utils'
import { getValidJson } from '../../utils'
describe('jsonValidator', () => {
it('should not throw an error with an valid json', () => {
@@ -6,7 +6,7 @@ describe('jsonValidator', () => {
test: 'test'
}
expect(isValidJson(json)).toBe(json)
expect(getValidJson(json)).toBe(json)
})
it('should not throw an error with an valid json string', () => {
@@ -14,7 +14,7 @@ describe('jsonValidator', () => {
test: 'test'
}
expect(isValidJson(JSON.stringify(json))).toStrictEqual(json)
expect(getValidJson(JSON.stringify(json))).toStrictEqual(json)
})
it('should throw an error with an invalid json', () => {
@@ -22,7 +22,7 @@ describe('jsonValidator', () => {
expect(() => {
try {
isValidJson(json)
getValidJson(json)
} catch (err) {
throw new Error()
}