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 46313bc1
authored
Feb 25, 2014
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap the test within prepareTransactionTest
1 parent
4ebe4bcc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
27 deletions
test/sequelize.transaction.test.js
test/sequelize.transaction.test.js
View file @
46313bc
...
@@ -118,35 +118,33 @@ describe(Support.getTestDialectTeaser("Sequelize#transaction"), function () {
...
@@ -118,35 +118,33 @@ describe(Support.getTestDialectTeaser("Sequelize#transaction"), function () {
})
})
describe
(
'complex long running example'
,
function
()
{
describe
(
'complex long running example'
,
function
()
{
it
(
"works"
,
function
(
done
)
{
it
(
"works with promise syntax"
,
function
(
done
)
{
var
sequelize
=
this
.
sequelize
Support
.
prepareTransactionTest
(
this
.
sequelize
,
function
(
sequelize
)
{
var
Test
=
sequelize
.
define
(
'Test'
,
{
var
Test
=
sequelize
.
define
(
'Test'
,
{
id
:
{
type
:
Support
.
Sequelize
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
id
:
{
type
:
Support
.
Sequelize
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
name
:
{
type
:
Support
.
Sequelize
.
STRING
}
name
:
{
type
:
Support
.
Sequelize
.
STRING
}
})
})
sequelize
sequelize
.
sync
({
force
:
true
})
.
sync
({
force
:
true
})
.
then
(
function
()
{
.
then
(
function
()
{
sequelize
.
transaction
(
function
(
transaction
)
{
sequelize
.
transaction
(
function
(
transaction
)
{
Test
Test
.
create
({
name
:
'Peter'
},
{
transaction
:
transaction
})
.
create
({
name
:
'Peter'
},
{
transaction
:
transaction
})
.
then
(
function
()
{
.
then
(
function
()
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
transaction
transaction
.
commit
()
.
commit
()
.
then
(
function
()
{
.
then
(
function
()
{
return
Test
.
count
()
})
return
Test
.
count
({
transaction
:
transaction
})
.
then
(
function
(
count
)
{
})
expect
(
count
).
to
.
equal
(
1
)
.
then
(
function
(
count
)
{
done
()
expect
(
count
).
to
.
equal
(
1
)
})
done
()
},
1000
)
})
})
},
1000
)
})
})
})
})
})
})
})
})
})
})
})
})
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