1
0
mirror of synced 2025-12-22 03:16:52 -05:00

Convert 28 JavaScript files to TypeScript (#57753)

This commit is contained in:
Kevin Heis
2025-10-06 09:07:33 -07:00
committed by GitHub
parent 140a3f7768
commit 822bdfff67
30 changed files with 126 additions and 88 deletions

View File

@@ -6,7 +6,8 @@ import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-v
import { DataDirectory } from '@/tests/helpers/data-directory'
describe('data tag', () => {
let dd
// Using 'any' type as DataDirectory is from data-directory.js which lacks type definitions
let dd: any
const enDirBefore = languages.en.dir
beforeAll(() => {
@@ -41,7 +42,7 @@ describe('data tag', () => {
currentLanguage: 'en',
currentPath: '/en/liquid-tags/good-data-variable',
}
const rendered = await page.render(context)
const rendered = await page!.render(context)
// The test fixture contains:
// {% data variables.stuff.foo %}
// which we control the value of here in the test.
@@ -57,7 +58,7 @@ describe('data tag', () => {
currentPath: '/en/liquid-tags/bad-data-variable',
currentLanguage: 'en',
}
await expect(page.render(context)).rejects.toThrow(
await expect(page!.render(context)).rejects.toThrow(
"Can't find the key 'foo.bar.tipu' in the scope., line:2, col:1",
)
})

View File

@@ -7,8 +7,10 @@ import { DataDirectory } from '@/tests/helpers/data-directory'
describe('liquid helper tags', () => {
vi.setConfig({ testTimeout: 60 * 1000 })
const context = {}
let dd
// Using 'any' type as context is a test fixture with dynamic properties set in beforeAll
const context: any = {}
// Using 'any' type as DataDirectory is from data-directory.js which lacks type definitions
let dd: any
const enDirBefore = languages.en.dir
beforeAll(() => {