Skip to content

Commit

Permalink
chore(explorer-e2e): typescript strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Feb 24, 2025
1 parent f1783ef commit bc45a51
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion apps/explorer-e2e/src/specs/address.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
import { ExplorerApp } from '../fixtures/ExplorerApp'
import { TEST_ADDRESS_1 } from '../fixtures/constants'
import { keys } from '../utils'

let explorerApp: ExplorerApp

Expand All @@ -22,7 +23,7 @@ test('address can be directly navigated to by id', async ({ page }) => {
})

test('address displays the intended data', async ({ page }) => {
const displayKeys = Object.keys(TEST_ADDRESS_1.display)
const displayKeys = keys(TEST_ADDRESS_1.display)

await explorerApp.goTo('/address/' + TEST_ADDRESS_1.id)

Expand Down
3 changes: 2 additions & 1 deletion apps/explorer-e2e/src/specs/block.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
import { ExplorerApp } from '../fixtures/ExplorerApp'
import { TEST_BLOCK_1 } from '../fixtures/constants'
import { keys } from '../utils'

let explorerApp: ExplorerApp

Expand Down Expand Up @@ -58,7 +59,7 @@ test('block can click through to a transaction', async ({ page }) => {
})

test('block displays the intended data', async ({ page }) => {
const displayKeys = Object.keys(TEST_BLOCK_1.display)
const displayKeys = keys(TEST_BLOCK_1.display)

await explorerApp.goTo('/block/' + TEST_BLOCK_1.height)

Expand Down
3 changes: 2 additions & 1 deletion apps/explorer-e2e/src/specs/contract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
RENEWED_TO_BUTTON,
TEST_CONTRACT_1,
} from '../fixtures/constants'
import { keys } from '../utils'

let explorerApp: ExplorerApp

Expand All @@ -26,7 +27,7 @@ test('contract can be directly navigated to', async ({ page }) => {
})

test('contract displays the intended data', async ({ page }) => {
const displayKeys = Object.keys(TEST_CONTRACT_1.display)
const displayKeys = keys(TEST_CONTRACT_1.display)

await explorerApp.goTo('/contract/' + TEST_CONTRACT_1.id)

Expand Down
3 changes: 2 additions & 1 deletion apps/explorer-e2e/src/specs/tx.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
import { ExplorerApp } from '../fixtures/ExplorerApp'
import { TEST_TX_1 } from '../fixtures/constants'
import { keys } from '../utils'

let explorerApp: ExplorerApp

Expand Down Expand Up @@ -45,7 +46,7 @@ test('transaction can click through to an address', async ({ page }) => {
})

test('transaction displays the intended data', async ({ page }) => {
const displayKeys = Object.keys(TEST_TX_1.display)
const displayKeys = keys(TEST_TX_1.display)

await explorerApp.goTo('/tx/' + TEST_TX_1.id)

Expand Down
4 changes: 4 additions & 0 deletions apps/explorer-e2e/src/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Properly typed version of Object.keys.
export function keys<T extends object>(obj: T) {
return Object.keys(obj) as Array<keyof T>
}
2 changes: 1 addition & 1 deletion apps/explorer-e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": false,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"resolveJsonModule": true,
Expand Down

0 comments on commit bc45a51

Please sign in to comment.