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 db688a53
authored
Jan 19, 2016
by
tornillo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent Promise (bluebird) warnings in tests (part 2)
1 parent
a9d473d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
test/integration/hooks.test.js
test/integration/hooks.test.js
View file @
db688a5
...
@@ -1161,7 +1161,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
...
@@ -1161,7 +1161,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
,
afterProject
=
false
,
afterProject
=
false
,
beforeTask
=
false
,
beforeTask
=
false
,
afterTask
=
false
,
afterTask
=
false
,
VeryCustomError
=
function
()
{}
;
,
CustomErrorText
=
'Whoops!'
;
this
.
Projects
.
beforeCreate
(
function
(
project
,
options
,
fn
)
{
this
.
Projects
.
beforeCreate
(
function
(
project
,
options
,
fn
)
{
beforeProject
=
true
;
beforeProject
=
true
;
...
@@ -1175,7 +1175,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
...
@@ -1175,7 +1175,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this
.
Tasks
.
beforeDestroy
(
function
(
task
,
options
,
fn
)
{
this
.
Tasks
.
beforeDestroy
(
function
(
task
,
options
,
fn
)
{
beforeTask
=
true
;
beforeTask
=
true
;
fn
(
new
VeryCustomError
(
'Whoops!'
));
fn
(
new
Error
(
CustomErrorText
));
});
});
this
.
Tasks
.
afterDestroy
(
function
(
task
,
options
,
fn
)
{
this
.
Tasks
.
afterDestroy
(
function
(
task
,
options
,
fn
)
{
...
@@ -1186,7 +1186,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
...
@@ -1186,7 +1186,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
return
this
.
Projects
.
create
({
title
:
'New Project'
}).
then
(
function
(
project
)
{
return
this
.
Projects
.
create
({
title
:
'New Project'
}).
then
(
function
(
project
)
{
return
self
.
Tasks
.
create
({
title
:
'New Task'
}).
then
(
function
(
task
)
{
return
self
.
Tasks
.
create
({
title
:
'New Task'
}).
then
(
function
(
task
)
{
return
project
.
setTask
(
task
).
then
(
function
()
{
return
project
.
setTask
(
task
).
then
(
function
()
{
return
expect
(
project
.
destroy
()).
to
.
eventually
.
be
.
rejectedWith
(
VeryCustomError
).
then
(
function
()
{
return
expect
(
project
.
destroy
()).
to
.
eventually
.
be
.
rejectedWith
(
CustomErrorText
).
then
(
function
()
{
expect
(
beforeProject
).
to
.
be
.
true
;
expect
(
beforeProject
).
to
.
be
.
true
;
expect
(
afterProject
).
to
.
be
.
true
;
expect
(
afterProject
).
to
.
be
.
true
;
expect
(
beforeTask
).
to
.
be
.
true
;
expect
(
beforeTask
).
to
.
be
.
true
;
...
@@ -1921,7 +1921,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
...
@@ -1921,7 +1921,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
,
afterTask
=
false
,
afterTask
=
false
,
beforeMiniTask
=
false
,
beforeMiniTask
=
false
,
afterMiniTask
=
false
,
afterMiniTask
=
false
,
VeryCustomError
=
function
()
{}
;
,
CustomErrorText
=
'Whoops!'
;
this
.
Projects
.
beforeCreate
(
function
()
{
this
.
Projects
.
beforeCreate
(
function
()
{
beforeProject
=
true
;
beforeProject
=
true
;
...
@@ -1933,7 +1933,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
...
@@ -1933,7 +1933,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this
.
Tasks
.
beforeDestroy
(
function
()
{
this
.
Tasks
.
beforeDestroy
(
function
()
{
beforeTask
=
true
;
beforeTask
=
true
;
throw
new
VeryCustomError
(
'Whoops!'
);
throw
new
Error
(
CustomErrorText
);
});
});
this
.
Tasks
.
afterDestroy
(
function
()
{
this
.
Tasks
.
afterDestroy
(
function
()
{
...
@@ -1958,7 +1958,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
...
@@ -1958,7 +1958,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
project
.
addTask
(
task
)
project
.
addTask
(
task
)
]).
return
(
project
);
]).
return
(
project
);
}).
then
(
function
(
project
)
{
}).
then
(
function
(
project
)
{
return
expect
(
project
.
destroy
()).
to
.
eventually
.
be
.
rejectedWith
(
VeryCustomError
).
then
(
function
()
{
return
expect
(
project
.
destroy
()).
to
.
eventually
.
be
.
rejectedWith
(
CustomErrorText
).
then
(
function
()
{
expect
(
beforeProject
).
to
.
be
.
true
;
expect
(
beforeProject
).
to
.
be
.
true
;
expect
(
afterProject
).
to
.
be
.
true
;
expect
(
afterProject
).
to
.
be
.
true
;
expect
(
beforeTask
).
to
.
be
.
true
;
expect
(
beforeTask
).
to
.
be
.
true
;
...
...
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