Skip to content

Instantly share code, notes, and snippets.

@chris-gunawardena
Last active July 6, 2018 11:30
Show Gist options
  • Save chris-gunawardena/e88084857a195c5b5d006201383f3599 to your computer and use it in GitHub Desktop.
Save chris-gunawardena/e88084857a195c5b5d006201383f3599 to your computer and use it in GitHub Desktop.
polymer test generator
copy(Reflect.ownKeys(Reflect.getPrototypeOf(element)).filter(p=>element [p] instanceof Function).map(funcName => `
suite('${funcName}()', () => {
test('yyyyy', () => {
assert.equal(element.${funcName}(''), 'xxxx');
});
});
`).join(''))
/* sample output */
suite('_getWeek', () => {
test('yyyyy', () => {
assert.equal(element._getWeek(''), 'xxxx');
});
});
suite('_dateChanged', () => {
test('yyyyy', () => {
assert.equal(element._dateChanged(''), 'xxxx');
});
});
suite('ready', () => {
test('yyyyy', () => {
assert.equal(element.ready(''), 'xxxx');
});
});
suite('_isDisabledDate', () => {
test('yyyyy', () => {
assert.equal(element._isDisabledDate(''), 'xxxx');
});
});
suite('_initDateElements', () => {
test('yyyyy', () => {
assert.equal(element._initDateElements(''), 'xxxx');
});
});
suite('_generateCss', () => {
test('yyyyy', () => {
assert.equal(element._generateCss(''), 'xxxx');
});
});
suite('_getDateElements', () => {
test('yyyyy', () => {
assert.equal(element._getDateElements(''), 'xxxx');
});
});
suite('_disableDates', () => {
test('yyyyy', () => {
assert.equal(element._disableDates(''), 'xxxx');
});
});
suite('_getNextSevenDays', () => {
test('yyyyy', () => {
assert.equal(element._getNextSevenDays(''), 'xxxx');
});
});
suite('_nextPrevClick', () => {
test('yyyyy', () => {
assert.equal(element._nextPrevClick(''), 'xxxx');
});
});
suite('_headerClick', () => {
test('yyyyy', () => {
assert.equal(element._headerClick(''), 'xxxx');
});
});
suite('_moveDate', () => {
test('yyyyy', () => {
assert.equal(element._moveDate(''), 'xxxx');
});
});
suite('_dateClick', () => {
test('yyyyy', () => {
assert.equal(element._dateClick(''), 'xxxx');
});
});
suite('_highlightDate', () => {
test('yyyyy', () => {
assert.equal(element._highlightDate(''), 'xxxx');
});
});
suite('_formatMonth', () => {
test('yyyyy', () => {
assert.equal(element._formatMonth(''), 'xxxx');
});
});
suite('_formatDate', () => {
test('yyyyy', () => {
assert.equal(element._formatDate(''), 'xxxx');
});
});
suite('_getFirstDayOfWeek', () => {
test('yyyyy', () => {
assert.equal(element._getFirstDayOfWeek(''), 'xxxx');
});
});
suite('j', () => {
test('yyyyy', () => {
assert.equal(element.j(''), 'xxxx');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment