mirror of
https://github.com/knex/knex.git
synced 2025-10-04 20:46:04 +00:00
19 lines
436 B
JavaScript
19 lines
436 B
JavaScript
'use strict';
|
|
|
|
var knex = require('../../lib/index');
|
|
var test = require('tape')
|
|
|
|
test('it should parse the connection string', function(t) {
|
|
t.plan(1)
|
|
var knexObj = knex({
|
|
client: 'mysql',
|
|
connection: "mysql://user:password@example.com/dbname"
|
|
})
|
|
t.deepEqual(knexObj.client.config.connection, {
|
|
database: 'dbname',
|
|
host: 'example.com',
|
|
password: 'password',
|
|
user: 'user'
|
|
})
|
|
knexObj.destroy()
|
|
}) |