Skip to content

Commit

Permalink
test: fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Nov 25, 2023
1 parent 83a9bb5 commit 00a1148
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"prepublishOnly": "pnpm build",
"release": "bumpp --commit --push --tag && pnpm publish",
"dev:playground": "pnpm vite -c playground/vite.config.ts",
"quick:test": "node --loader ts-node/esm bin/test.ts",
"test": "node --loader ts-node/esm bin/test.ts",
"quick:test": "node --enable-source-maps --loader ts-node/esm bin/test.ts",
"test": "node --enable-source-maps --loader ts-node/esm bin/test.ts",
"typecheck": "tsc --noEmit",
"checks": "pnpm lint && pnpm typecheck"
},
Expand Down
6 changes: 5 additions & 1 deletion playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/* eslint-disable @typescript-eslint/prefer-ts-expect-error */
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-unused-vars */

// @ts-ignore
import { z } from 'zod'
import { defineConfig } from 'vite'

// @ts-expect-error osef
// @ts-ignore
import { Schema, ValidateEnv } from '../src/index.js'

export default defineConfig({
Expand Down
10 changes: 8 additions & 2 deletions tests/common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,13 @@ test.group('vite-plugin-validate-env', () => {
}

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_TESTX): not boolean')
const messages = logs.map((log) => log.message)
assert.isDefined(
messages.find(
(message) => message === 'cyan([vite-plugin-validate-env]) debug process.env content',
),
)

assert.isDefined(messages.find((message) => message.includes('cyan(VITE_TESTX): not boolean')))
})
})

0 comments on commit 00a1148

Please sign in to comment.