2020-08-06 23:39:05 +03:00
|
|
|
var helpers = require('../helpers');
|
|
|
|
var mark = helpers.mark;
|
|
|
|
var extract = helpers.extract;
|
|
|
|
var refer = helpers.refer;
|
|
|
|
|
2020-08-08 23:26:39 +03:00
|
|
|
describe('Helpers', function () {
|
|
|
|
it('mark', function () {
|
2020-08-06 23:39:05 +03:00
|
|
|
expect(mark({ testData: 'test' }, 'testType')).toMatchSnapshot();
|
|
|
|
expect(
|
|
|
|
mark({ testData: 'test' }, 'testType', 'toString')
|
|
|
|
).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
2020-08-08 23:26:39 +03:00
|
|
|
it('extract', function () {
|
2020-08-06 23:39:05 +03:00
|
|
|
expect(extract({ testData: 'test' }, 'testType')).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
2020-08-08 23:26:39 +03:00
|
|
|
it('refer', function () {
|
|
|
|
var TestClass = function (data) {
|
2020-08-06 23:39:05 +03:00
|
|
|
return data;
|
|
|
|
};
|
|
|
|
var testInstance = new TestClass({ testData: 'test' });
|
|
|
|
expect(
|
|
|
|
refer(testInstance, 'testType', false, [TestClass])
|
|
|
|
).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|