Skip to content

Commit

Permalink
renable backfills missing translation site data test (github#25303)
Browse files Browse the repository at this point in the history
* renable backfills missing translation site data test

* adding a code comment to explain how finally relates to jest
  • Loading branch information
peterbe authored Feb 24, 2022
1 parent 465e7d6 commit 6bc2600
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tests/content/site-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,19 @@ describe('siteData module (English)', () => {
expect(reusable.includes('任意のページの左上で')).toBe(true)
})

// TODO: re-enable once Janky flakyness is resolved
// Docs Engineering issue: 964
test.skip('backfills missing translated site data with English values', async () => {
test('backfills missing translated site data with English values', async () => {
const newFile = path.join(__dirname, '../../data/newfile.yml')
await fs.writeFile(newFile, 'newvalue: bar')
const data = await loadSiteData()
expect(get(data, 'en.site.data.newfile.newvalue')).toEqual('bar')
expect(get(data, 'ja.site.data.newfile.newvalue')).toEqual('bar')
await fs.unlink(newFile)
fs.writeFileSync(newFile, 'newvalue: bar')
try {
const data = loadSiteData()
expect(get(data, 'en.site.data.newfile.newvalue')).toEqual('bar')
expect(get(data, 'ja.site.data.newfile.newvalue')).toEqual('bar')
} finally {
// If an error is thrown above, it will still "bubble up"
// to the jest reporter, but we still always need to clean up
// the temporary file.
fs.unlinkSync(newFile)
}
})

test('all Liquid templating is valid', async () => {
Expand Down

0 comments on commit 6bc2600

Please sign in to comment.