Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit cb6c493d
authored
Dec 20, 2016
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Lint
1 parent
b2682cf9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
lib/dialects/abstract/connection-manager.js
test/unit/connection-manager.test.js
lib/dialects/abstract/connection-manager.js
View file @
cb6c493
...
@@ -246,7 +246,7 @@ ConnectionManager.prototype.$connect = function(config) {
...
@@ -246,7 +246,7 @@ ConnectionManager.prototype.$connect = function(config) {
return
this
.
sequelize
.
runHooks
(
'beforeConnect'
,
config
).
bind
(
this
).
then
(
function
()
{
return
this
.
sequelize
.
runHooks
(
'beforeConnect'
,
config
).
bind
(
this
).
then
(
function
()
{
return
this
.
dialect
.
connectionManager
.
connect
(
config
);
return
this
.
dialect
.
connectionManager
.
connect
(
config
);
}).
then
(
function
(
connection
)
{
}).
then
(
function
(
connection
)
{
return
this
.
sequelize
.
runHooks
(
'afterConnect'
,
connection
,
config
).
return
(
connection
)
return
this
.
sequelize
.
runHooks
(
'afterConnect'
,
connection
,
config
).
return
(
connection
)
;
});
});
};
};
ConnectionManager
.
prototype
.
$disconnect
=
function
(
connection
)
{
ConnectionManager
.
prototype
.
$disconnect
=
function
(
connection
)
{
...
@@ -254,7 +254,7 @@ ConnectionManager.prototype.$disconnect = function(connection) {
...
@@ -254,7 +254,7 @@ ConnectionManager.prototype.$disconnect = function(connection) {
};
};
ConnectionManager
.
prototype
.
$validate
=
function
(
connection
)
{
ConnectionManager
.
prototype
.
$validate
=
function
(
connection
)
{
if
(
!
this
.
dialect
.
connectionManager
.
validate
)
return
true
if
(
!
this
.
dialect
.
connectionManager
.
validate
)
return
true
;
return
this
.
dialect
.
connectionManager
.
validate
(
connection
);
return
this
.
dialect
.
connectionManager
.
validate
(
connection
);
};
};
...
...
test/unit/connection-manager.test.js
View file @
cb6c493
...
@@ -62,16 +62,16 @@ describe('connection manager', function () {
...
@@ -62,16 +62,16 @@ describe('connection manager', function () {
});
});
it
(
'should call afterConnect'
,
function
()
{
it
(
'should call afterConnect'
,
function
()
{
const
spy
=
sinon
.
spy
();
var
spy
=
sinon
.
spy
();
this
.
sequelize
.
afterConnect
(
spy
);
this
.
sequelize
.
afterConnect
(
spy
);
var
connectionManager
=
new
ConnectionManager
(
this
.
dialect
,
this
.
sequelize
);
var
connectionManager
=
new
ConnectionManager
(
this
.
dialect
,
this
.
sequelize
);
return
connectionManager
.
$connect
({}).
then
(
()
=>
{
return
connectionManager
.
$connect
({}).
then
(
function
()
{
expect
(
spy
.
callCount
).
to
.
equal
(
1
);
expect
(
spy
.
callCount
).
to
.
equal
(
1
);
expect
(
spy
.
firstCall
.
args
[
0
]).
to
.
equal
(
this
.
connection
);
expect
(
spy
.
firstCall
.
args
[
0
]).
to
.
equal
(
this
.
connection
);
expect
(
spy
.
firstCall
.
args
[
1
]).
to
.
eql
({});
expect
(
spy
.
firstCall
.
args
[
1
]).
to
.
eql
({});
});
}
.
bind
(
this
)
);
});
});
});
});
});
});
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment