Skip to content

Commit

Permalink
fix flakey test
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus committed Mar 23, 2023
1 parent cacd9e6 commit e17753c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/relative-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,14 @@ suite('relative-time', function () {
})

test('micro formats years', async () => {
const now = new Date(Date.now() - 10 * 365 * 24 * 60 * 60 * 1000).toISOString()
const datetime = new Date()
datetime.setFullYear(datetime.getFullYear() - 10)
const time = document.createElement('relative-time')
time.setAttribute('tense', 'past')
time.setAttribute('datetime', now)
time.setAttribute('datetime', datetime)
time.setAttribute('format', 'micro')
await Promise.resolve()
assert.equal(time.shadowRoot.textContent, '11y')
assert.equal(time.shadowRoot.textContent, '10y')
})

test('micro formats future times', async () => {
Expand Down

0 comments on commit e17753c

Please sign in to comment.