This commit is contained in:
Nathan Bierema 2021-08-26 23:09:14 -04:00
parent 8a8b2b17a7
commit aa74936e8a

View File

@ -21,6 +21,7 @@ describe('Immutable', function () {
const stringified: { [key: string]: string } = {};
describe('Stringify', function () {
Object.keys(data).forEach(function (key) {
// eslint-disable-next-line jest/valid-title
it(key, function () {
stringified[key] = stringify(data[key as keyof typeof data]);
expect(stringified[key]).toMatchSnapshot();
@ -30,6 +31,7 @@ describe('Immutable', function () {
describe('Parse', function () {
Object.keys(data).forEach(function (key) {
// eslint-disable-next-line jest/valid-title
it(key, function () {
expect(parse(stringified[key])).toEqual(data[key as keyof typeof data]);
});
@ -142,9 +144,11 @@ describe('Immutable', function () {
const stringified = serializeCustom.stringify(
data[key as keyof typeof data]
);
// eslint-disable-next-line jest/valid-title
it(key, function () {
const deserialized = serializeCustom.parse(stringified);
expect(deserialized).toEqual(data[key as keyof typeof data]);
// eslint-disable-next-line jest/no-conditional-expect
if (key === 'map' || key === 'orderedMap') {
const deserializedDefault = parse(stringified);
expect(