Skip to content

Commit

Permalink
Merge pull request #94 from expatfile/development
Browse files Browse the repository at this point in the history
🔖 Release to staging
  • Loading branch information
HofmannZ authored Nov 20, 2023
2 parents 6458ed0 + 8e0c738 commit ce54bf8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/script/env-script.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('EnvProvider', () => {
const { getByTestId } = render(<EnvScript env={env} />);

expect(getByTestId('env-script').textContent).toBe(
`window[__ENV] = ${JSON.stringify(env)}`,
`window['__ENV'] = ${JSON.stringify(env)}`,
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/script/env-script.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const EnvScript: FC<EnvScriptProps> = ({ env, nonce }) => {
data-testid="env-script"
nonce={nonceString}
dangerouslySetInnerHTML={{
__html: `window[${PUBLIC_ENV_KEY}] = ${JSON.stringify(env)}`,
__html: `window['${PUBLIC_ENV_KEY}'] = ${JSON.stringify(env)}`,
}}
/>
);
Expand Down
6 changes: 3 additions & 3 deletions src/script/public-env-script.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('PublicEnvProvider', () => {
const { getByTestId } = render(<PublicEnvScript />);

expect(getByTestId('env-script').textContent).toBe(
`window[__ENV] = {"NEXT_PUBLIC_FOO":"foo-value"}`,
`window['__ENV'] = {"NEXT_PUBLIC_FOO":"foo-value"}`,
);
});

Expand All @@ -40,7 +40,7 @@ describe('PublicEnvProvider', () => {

const { getByTestId } = render(<PublicEnvScript />);

expect(getByTestId('env-script').textContent).toBe(`window[__ENV] = {}`);
expect(getByTestId('env-script').textContent).toBe(`window['__ENV'] = {}`);
});

it('should only set public env in the script', () => {
Expand All @@ -52,7 +52,7 @@ describe('PublicEnvProvider', () => {
const { getByTestId } = render(<PublicEnvScript />);

expect(getByTestId('env-script').textContent).toBe(
`window[__ENV] = {"NEXT_PUBLIC_FOO":"foo-value"}`,
`window['__ENV'] = {"NEXT_PUBLIC_FOO":"foo-value"}`,
);
});

Expand Down

0 comments on commit ce54bf8

Please sign in to comment.