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 e25cde75
authored
Jul 24, 2013
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reformatted the specs
1 parent
600d8830
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
35 deletions
test/configuration.test.js
test/configuration.test.js
View file @
e25cde7
...
@@ -11,30 +11,27 @@ chai.Assertion.includeStack = true
...
@@ -11,30 +11,27 @@ chai.Assertion.includeStack = true
describe
(
Support
.
getTestDialectTeaser
(
"Configuration"
),
function
()
{
describe
(
Support
.
getTestDialectTeaser
(
"Configuration"
),
function
()
{
describe
(
'Connections problems should fail with a nice message'
,
function
()
{
describe
(
'Connections problems should fail with a nice message'
,
function
()
{
it
(
'when we don\'t have the correct server details'
,
function
(
done
)
{
it
(
"when we don't have the correct server details"
,
function
(
done
)
{
if
(
noDomains
===
true
)
{
if
(
noDomains
===
true
)
{
console
.
log
(
'WARNING: Configuration specs requires NodeJS version >= 0.8 for full compatibility'
)
console
.
log
(
'WARNING: Configuration specs requires NodeJS version >= 0.8 for full compatibility'
)
expect
(
''
).
toEqual
(
''
)
// Silence Buster!
done
()
return
done
()
}
else
{
}
var
seq
=
new
Sequelize
(
config
[
dialect
].
database
,
config
[
dialect
].
username
,
config
[
dialect
].
password
,
{
storage
:
'/path/to/no/where/land'
,
logging
:
false
,
host
:
'0.0.0.1'
,
port
:
config
[
dialect
].
port
,
dialect
:
dialect
})
,
Domain
=
require
(
'domain'
)
(
function
()
{
,
domain
=
Domain
.
create
()
var
sequelizeSpecific2
=
new
Sequelize
(
config
[
dialect
].
database
,
config
[
dialect
].
username
,
config
[
dialect
].
password
,
{
storage
:
'/path/to/no/where/land'
,
logging
:
false
,
host
:
'0.0.0.1'
,
port
:
config
[
dialect
].
port
,
dialect
:
dialect
})
,
domain
=
require
(
'domain'
)
domain
.
on
(
'error'
,
function
(
err
){
,
d
=
domain
.
create
()
expect
(
err
.
toString
()).
to
.
match
(
/Failed to find
(
.*
?)
Please double check your settings
\.
/
)
domain
.
remove
(
seq
.
query
)
d
.
on
(
'error'
,
function
(
err
){
expect
(
err
).
to
.
match
(
/Failed to find
(
.*
?)
Please double check your settings
\.
/
)
d
.
remove
(
sequelizeSpecific2
.
query
)
done
()
done
()
})
})
d
.
run
(
function
(){
d
omain
.
run
(
function
(){
d
.
add
(
sequelizeSpecific2
.
query
)
d
omain
.
add
(
seq
.
query
)
seq
uelizeSpecific2
.
query
(
'select 1 as hello'
)
seq
.
query
(
'select 1 as hello'
)
.
success
(
function
(){})
.
success
(
function
(){})
})
})
}
)()
}
})
})
it
(
'when we don\'t have the correct login information'
,
function
(
done
)
{
it
(
'when we don\'t have the correct login information'
,
function
(
done
)
{
...
@@ -42,31 +39,26 @@ describe(Support.getTestDialectTeaser("Configuration"), function() {
...
@@ -42,31 +39,26 @@ describe(Support.getTestDialectTeaser("Configuration"), function() {
console
.
log
(
'This dialect doesn\'t support me :('
)
console
.
log
(
'This dialect doesn\'t support me :('
)
expect
(
''
).
toEqual
(
''
)
// Silence Buster
expect
(
''
).
toEqual
(
''
)
// Silence Buster
return
done
()
return
done
()
}
}
else
if
(
noDomains
===
true
)
{
if
(
noDomains
===
true
)
{
console
.
log
(
'WARNING: Configuration specs requires NodeJS version >= 0.8 for full compatibility'
)
console
.
log
(
'WARNING: Configuration specs requires NodeJS version >= 0.8 for full compatibility'
)
expect
(
''
).
toEqual
(
''
)
// Silence Buster!
expect
(
''
).
toEqual
(
''
)
// Silence Buster!
return
done
()
return
done
()
}
}
else
{
var
seq
=
new
Sequelize
(
config
[
dialect
].
database
,
config
[
dialect
].
username
,
'fakepass123'
,
{
logging
:
false
,
host
:
config
[
dialect
].
host
,
port
:
1
,
dialect
:
dialect
})
(
function
()
{
,
Domain
=
require
(
'domain'
)
var
sequelizeSpecific1
=
new
Sequelize
(
config
[
dialect
].
database
,
config
[
dialect
].
username
,
'fakepass123'
,
{
logging
:
false
,
host
:
config
[
dialect
].
host
,
port
:
1
,
dialect
:
dialect
})
,
domain
=
Domain
.
create
()
,
domain
=
require
(
'domain'
)
,
d
=
domain
.
create
()
domain
.
on
(
'error'
,
function
(
err
){
expect
(
err
.
toString
()).
to
.
match
(
/^Failed to authenticate/
)
d
.
on
(
'error'
,
function
(
err
){
domain
.
remove
(
seq
.
query
)
expect
(
err
).
to
.
match
(
/^Failed to authenticate/
)
d
.
remove
(
sequelizeSpecific1
.
query
)
done
()
done
()
})
})
d
.
run
(
function
(){
domain
.
run
(
function
(){
d
.
add
(
sequelizeSpecific1
.
query
)
domain
.
add
(
seq
.
query
)
sequelizeSpecific1
.
query
(
'select 1 as hello'
)
seq
.
query
(
'select 1 as hello'
).
success
(
function
(){})
.
success
(
function
(){})
})
})
}
)()
}
})
})
it
(
'when we don\'t have a valid dialect.'
,
function
(
done
)
{
it
(
'when we don\'t have a valid dialect.'
,
function
(
done
)
{
...
...
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