insomnia/app/templating/extensions/__tests__/timestamp-extension.test.js
2017-07-19 20:36:44 -07:00

17 lines
447 B
JavaScript

import * as templating from '../../index';
import {globalBeforeEach} from '../../../__jest__/before-each';
function assertTemplate (txt, expected) {
return async function () {
const result = await templating.render(txt);
expect(result).toMatch(expected);
};
}
const millisRe = /^\d{13}$/;
describe('TimestampExtension', () => {
beforeEach(globalBeforeEach);
it('renders basic', assertTemplate('{% timestamp %}', millisRe));
});