mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
[ci] format
This commit is contained in:
parent
0a4b31ffeb
commit
ea8582f4fc
3 changed files with 10 additions and 7 deletions
|
@ -90,8 +90,8 @@ export const ASTRO_CONFIG_DEFAULTS = {
|
|||
globalRoutePriority: false,
|
||||
rewriting: false,
|
||||
env: {
|
||||
validateSecrets: false
|
||||
}
|
||||
validateSecrets: false,
|
||||
},
|
||||
},
|
||||
} satisfies AstroUserConfig & { server: { open: boolean } };
|
||||
|
||||
|
@ -529,7 +529,10 @@ export const AstroConfigSchema = z.object({
|
|||
env: z
|
||||
.object({
|
||||
schema: EnvSchema.optional(),
|
||||
validateSecrets: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.env.validateSecrets)
|
||||
validateSecrets: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.default(ASTRO_CONFIG_DEFAULTS.experimental.env.validateSecrets),
|
||||
})
|
||||
.strict()
|
||||
.optional(),
|
||||
|
|
|
@ -13,12 +13,12 @@ describe('astro:env secret variables', () => {
|
|||
afterEach(async () => {
|
||||
await devServer?.stop();
|
||||
if (process.env.KNOWN_SECRET) {
|
||||
delete process.env.KNOWN_SECRET
|
||||
delete process.env.KNOWN_SECRET;
|
||||
}
|
||||
});
|
||||
|
||||
it('works in dev', async () => {
|
||||
process.env.KNOWN_SECRET = '5'
|
||||
process.env.KNOWN_SECRET = '5';
|
||||
fixture = await loadFixture({
|
||||
root: './fixtures/astro-env-server-secret/',
|
||||
});
|
||||
|
@ -80,7 +80,7 @@ describe('astro:env secret variables', () => {
|
|||
|
||||
try {
|
||||
await fixture.build();
|
||||
assert.fail()
|
||||
assert.fail();
|
||||
} catch (error) {
|
||||
assert.equal(error instanceof Error, true);
|
||||
assert.equal(error.title, 'Invalid Environment Variables');
|
||||
|
|
Loading…
Reference in a new issue