Skip to content

Commit

Permalink
ci: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Nov 25, 2023
1 parent 66d9ea7 commit 83a9bb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: pnpm install

- name: Typecheck
run: pnpm typechec
run: pnpm typecheck

test:
runs-on: ubuntu-latest
Expand Down
11 changes: 4 additions & 7 deletions tests/common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,24 +254,21 @@ test.group('vite-plugin-validate-env', () => {
test('log variables even if validation is failing', async ({ assert, fs }) => {
const plugin = ValidateEnv({
validator: 'builtin',
schema: { VITE_BOOLEAN: Schema.boolean() },
schema: { VITE_TESTX: Schema.boolean() },
debug: true,
})

await fs.create('.env.development', 'VITE_BOOLEAN=not boolean')
await fs.create('.env.development', 'VITE_TESTX=not boolean')

try {
// @ts-ignore
await plugin.config({ root: fs.basePath }, viteEnvConfig)
} catch (error: any) {
assert.include(
error.message,
'Value for environment variable "VITE_BOOLEAN" must be a boolean',
)
assert.include(error.message, 'Value for environment variable "VITE_TESTX" must be a boolean')
}

const logs = ui.logger.getLogs()
assert.deepEqual(logs[0].message, 'cyan([vite-plugin-validate-env]) debug process.env content')
assert.deepInclude(logs[1].message, 'cyan(VITE_BOOLEAN): not boolean')
assert.deepInclude(logs[1].message, 'cyan(VITE_TESTX): not boolean')
})
})

0 comments on commit 83a9bb5

Please sign in to comment.