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 4c6c293c
authored
Apr 02, 2015
by
Ruben Bridgewater
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hotfix and refactor more tests
1 parent
76d386e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
test/integration/dialects/mysql/connector-manager.test.js
test/integration/model/find.test.js
test/integration/dialects/mysql/connector-manager.test.js
View file @
4c6c293
...
@@ -10,25 +10,24 @@ chai.config.includeStack = true;
...
@@ -10,25 +10,24 @@ chai.config.includeStack = true;
if
(
Support
.
dialectIsMySQL
())
{
if
(
Support
.
dialectIsMySQL
())
{
describe
(
'[MYSQL Specific] Connector Manager'
,
function
()
{
describe
(
'[MYSQL Specific] Connector Manager'
,
function
()
{
it
(
'works correctly after being idle'
,
function
(
done
)
{
it
(
'works correctly after being idle'
,
function
()
{
var
User
=
this
.
sequelize
.
define
(
'User'
,
{
username
:
DataTypes
.
STRING
})
var
User
=
this
.
sequelize
.
define
(
'User'
,
{
username
:
DataTypes
.
STRING
})
,
spy
=
sinon
.
spy
();
,
spy
=
sinon
.
spy
();
User
.
sync
({
force
:
true
}).
then
(
function
()
{
return
User
.
sync
({
force
:
true
}).
then
(
function
()
{
User
.
create
({
username
:
'user1'
}).
then
(
function
()
{
return
User
.
create
({
username
:
'user1'
}).
then
(
function
()
{
User
.
count
().
then
(
function
(
count
)
{
return
User
.
count
().
then
(
function
(
count
)
{
expect
(
count
).
to
.
equal
(
1
);
expect
(
count
).
to
.
equal
(
1
);
spy
();
spy
();
return
this
.
sequelize
.
Promise
.
delay
(
1000
).
then
(
function
()
{
setTimeout
(
function
()
{
return
User
.
count
().
then
(
function
(
count
)
{
User
.
count
().
then
(
function
(
count
)
{
expect
(
count
).
to
.
equal
(
1
);
expect
(
count
).
to
.
equal
(
1
);
spy
();
spy
();
if
(
spy
.
calledTwice
)
{
if
(
!
spy
.
calledTwice
)
{
done
(
);
throw
new
Error
(
'Spy was not called twice'
);
}
}
});
});
}
,
1000
);
});
});
});
});
});
});
});
...
...
test/integration/model/find.test.js
View file @
4c6c293
...
@@ -260,7 +260,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
...
@@ -260,7 +260,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
,
count
=
0
;
,
count
=
0
;
return
this
.
User
.
bulkCreate
([{
username
:
'jack'
},
{
username
:
'jack'
}]).
then
(
function
()
{
return
this
.
User
.
bulkCreate
([{
username
:
'jack'
},
{
username
:
'jack'
}]).
then
(
function
()
{
return
this
.
sequelize
.
Promise
.
map
(
permutations
,
function
(
perm
)
{
return
self
.
sequelize
.
Promise
.
map
(
permutations
,
function
(
perm
)
{
return
self
.
User
.
find
(
perm
).
then
(
function
(
user
)
{
return
self
.
User
.
find
(
perm
).
then
(
function
(
user
)
{
expect
(
user
).
to
.
be
.
null
;
expect
(
user
).
to
.
be
.
null
;
count
++
;
count
++
;
...
@@ -297,7 +297,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
...
@@ -297,7 +297,7 @@ describe(Support.getTestDialectTeaser('Model'), function() {
self
.
Task
=
self
.
sequelize
.
define
(
'Task'
,
{
title
:
Sequelize
.
STRING
});
self
.
Task
=
self
.
sequelize
.
define
(
'Task'
,
{
title
:
Sequelize
.
STRING
});
self
.
Worker
=
self
.
sequelize
.
define
(
'Worker'
,
{
name
:
Sequelize
.
STRING
});
self
.
Worker
=
self
.
sequelize
.
define
(
'Worker'
,
{
name
:
Sequelize
.
STRING
});
return
this
.
init
=
function
(
callback
)
{
this
.
init
=
function
(
callback
)
{
return
self
.
sequelize
.
sync
({
force
:
true
}).
then
(
function
()
{
return
self
.
sequelize
.
sync
({
force
:
true
}).
then
(
function
()
{
return
self
.
Worker
.
create
({
name
:
'worker'
}).
then
(
function
(
worker
)
{
return
self
.
Worker
.
create
({
name
:
'worker'
}).
then
(
function
(
worker
)
{
return
self
.
Task
.
create
({
title
:
'homework'
}).
then
(
function
(
task
)
{
return
self
.
Task
.
create
({
title
:
'homework'
}).
then
(
function
(
task
)
{
...
...
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