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 566bbcf5
authored
Jul 30, 2013
by
Daniel Durante
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into milestones/2.0.0
2 parents
9f4fca12
1133077c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
29 deletions
README.md
test/postgres/associations.test.js
test/query-interface.test.js
test/support.js
README.md
View file @
566bbcf
...
...
@@ -139,30 +139,27 @@ $ npm install
### 4. Run the tests ###
Right now, the test base is split into the
`
spec
`
folder (which contains the
lovely
[
BusterJS
](
http://busterjs.org
)
tests).
Right now, the test base is split into the
`
test
`
folder (which contains the
lovely
[
Mocha
](
http://visionmedia.github.io/mocha/
)
tests).
As you might haven't installed all of the supported SQL dialects, here is how
to run the test suites for your development environment:
```
console
$
#
run all tests at once:
$
npm
test
$
#
run all of the buster specs (for all dialects):
$
npm
run test-buster
$
make
all
$
#
run the buster specs for mysql:
$
npm
run test-buster-
mysql
$
make
mysql
$
#
run the buster specs for sqlite:
$
npm
run test-buster-
sqlite
$
make
sqlite
$
#
run the buster specs for postgresql:
$
npm
run test-buster-postgres
$
make
pgsql
$
#
alternatively you can pass database credentials with $variables when testing
with buster.js
$
DIALECT=dialect
SEQ_DB=database SEQ_USER=user SEQ_PW=password
buster-
test
$
#
alternatively you can pass database credentials with $variables when testing
$
DIALECT=dialect
SEQ_DB=database SEQ_USER=user SEQ_PW=password
make
test
```
### 5. That's all ###
...
...
test/postgres/associations.test.js
View file @
566bbcf
...
...
@@ -9,11 +9,6 @@ chai.Assertion.includeStack = true
if
(
dialect
.
match
(
/^postgres/
))
{
describe
(
'[POSTGRES Specific] associations'
,
function
()
{
beforeEach
(
function
(
done
)
{
this
.
sequelize
.
options
.
quoteIdentifier
=
true
done
()
})
describe
(
'many-to-many'
,
function
()
{
describe
(
'where tables have the same prefix'
,
function
()
{
it
(
"should create a table wp_table1wp_table2s"
,
function
(
done
)
{
...
...
@@ -76,17 +71,15 @@ if (dialect.match(/^postgres/)) {
tasks
[
tasks
.
length
]
=
{
name
:
'Task'
+
Math
.
random
()}
}
self
.
sequelize
.
getQueryInterface
().
dropAllTables
().
success
(
function
()
{
self
.
User
.
sync
({
force
:
true
}).
success
(
function
()
{
self
.
Task
.
sync
({
force
:
true
}).
success
(
function
()
{
self
.
User
.
bulkCreate
(
users
).
success
(
function
()
{
self
.
Task
.
bulkCreate
(
tasks
).
success
(
function
()
{
self
.
User
.
all
().
success
(
function
(
_users
)
{
self
.
Task
.
all
().
success
(
function
(
_tasks
)
{
self
.
user
=
_users
[
0
]
self
.
task
=
_tasks
[
0
]
done
()
})
self
.
User
.
sync
({
force
:
true
}).
success
(
function
()
{
self
.
Task
.
sync
({
force
:
true
}).
success
(
function
()
{
self
.
User
.
bulkCreate
(
users
).
success
(
function
()
{
self
.
Task
.
bulkCreate
(
tasks
).
success
(
function
()
{
self
.
User
.
all
().
success
(
function
(
_users
)
{
self
.
Task
.
all
().
success
(
function
(
_tasks
)
{
self
.
user
=
_users
[
0
]
self
.
task
=
_tasks
[
0
]
done
()
})
})
})
...
...
test/query-interface.test.js
View file @
566bbcf
...
...
@@ -48,7 +48,7 @@ describe(Support.getTestDialectTeaser("QueryInterface"), function () {
})
describe
(
'indexes'
,
function
()
{
before
(
function
(
done
)
{
before
Each
(
function
(
done
)
{
var
self
=
this
this
.
queryInterface
.
dropTable
(
'Users'
).
success
(
function
()
{
self
.
queryInterface
.
createTable
(
'Users'
,
{
...
...
test/support.js
View file @
566bbcf
...
...
@@ -121,7 +121,7 @@ before(function(done) {
done
()
})
after
Each
(
function
(
done
)
{
before
Each
(
function
(
done
)
{
Support
.
clearDatabase
(
this
.
sequelize
,
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