Skip to content

Commit

Permalink
Merge pull request #1277 from oasisprotocol/lw/test-env-types
Browse files Browse the repository at this point in the history
Test and fix process.env types
  • Loading branch information
lukaw3d authored Feb 21, 2024
2 parents 458599b + 61a2e84 commit 38181ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelog/1277.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test and fix process.env types
2 changes: 2 additions & 0 deletions src/global.d.ts → src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ declare global {
}
}
}

export {}
10 changes: 10 additions & 0 deletions src/types/global.typetest.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export function ExpectEnvToHaveStrictType() {
process.env.REACT_APP_SHOW_BUILD_BANNERS = undefined
process.env.REACT_APP_SHOW_BUILD_BANNERS = 'true'
process.env.REACT_APP_API = 'https://'

// @ts-expect-error Expect typescript to detect unsupported value
process.env.REACT_APP_SHOW_BUILD_BANNERS = 'unsupported_value'
// @ts-expect-error Expect typescript to detect required field
process.env.REACT_APP_API = undefined
}

0 comments on commit 38181ef

Please sign in to comment.