You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restore beta error wording in cli-*.test.ts; restructure mssql validator
Tests
- cli-{check,export,generate,migrate,pull,push,studio}.test.ts: assertion text
for every `validate config #N` case now matches beta's exact wording
byte-for-byte, constructed via the same error() / wrapParam() helpers the
runtime uses. The mechanism is res.error.message (not console.log spy +
process.exit) because the cli path throws DrizzleCliError; the literal
text it asserts is identical to beta.
- cli-studio.test.ts #5/#6: prepareStudioConfig is still in the legacy
humanLog + process.exit path, so those tests keep beta's spy mechanism
unchanged; the only deviation is stripAnsi() on captured calls because
withStyle.error wraps the message with chalk codes.
Runtime
- validations/common.ts: configCommonSchema.dialect is now optional. The
early MissingConfigDialectCliError throw in drizzleConfigFromFile is gone
so each prepare* helper owns the dialect-missing wording (mirrors beta).
- commands/utils.ts:
- prepareCheckParams: wrapParam('dialect', config.dialect) was being
passed the imported zod schema; pass the actual config value.
- prepareGenerateConfig + prepareExportConfig: reorder RequiredParamsCliError
builders to dialect-first / schema-second; drop the wrapParam('out',...)
line from generate so the message matches beta exactly.
- drizzleConfigFromFile: removed the chalk.grey wrap around "Reading config
file" so spy assertions can compare against plain text (matches beta).
- validations/mssql.ts: rewrote printConfigConnectionIssues to match the
postgres.ts shape — url branch, server-form branch, generic fallthrough
with "Either connection \"url\" or \"server\", \"user\", \"password\" are
required for MsSQL database connection". The previous form duplicated the
same "Please provide required params for MsSQL driver:" header on both
branches and had no fallthrough.
Verified
- pnpm tsc --noEmit -p tsconfig.json + tsconfig.typetest.json both clean
- TEST_CONFIG_PATH_PREFIX=./tests/cli/ vitest run tests/other/ → 376/376 pass
` Invalid input Please specify a 'dbCredentials' param in config. It will help drizzle to know how to query you database. You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`,
0 commit comments