redux-devtools/packages/redux-devtools-serialize/test/helpers.spec.ts
renovate[bot] 7e4cea6fa9
chore(deps): update typescript-eslint monorepo to v5 (major) (#907)
* chore(deps): update typescript-eslint monorepo to v5

* Update

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2021-10-21 19:08:35 +00:00

27 lines
706 B
TypeScript

import { mark, extract, refer } from '../src/helpers';
describe('Helpers', function () {
it('mark', function () {
expect(mark({ testData: 'test' }, 'testType')).toMatchSnapshot();
expect(
mark({ testData: 'test' }, 'testType', 'toString')
).toMatchSnapshot();
});
it('extract', function () {
expect(extract({ testData: 'test' }, 'testType')).toMatchSnapshot();
});
it('refer', function () {
const TestClass = function (data: unknown) {
return data;
};
const testInstance = new (TestClass as any)({
testData: 'test',
}) as unknown;
expect(
refer(testInstance, 'testType', false, [TestClass as any])
).toMatchSnapshot();
});
});