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 fcb9c077
authored
Nov 24, 2011
by
sdepold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create a dummy sequelize meta object to actually test the behavior
1 parent
01210931
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
spec/migrator.spec.js
spec/migrator.spec.js
View file @
fcb9c07
...
...
@@ -6,14 +6,21 @@ var config = require("./config/config")
describe
(
'Migrator'
,
function
()
{
describe
(
'getUndoneMigrations'
,
function
()
{
var
migrator
=
null
var
migrator
=
null
,
SequelizeMeta
=
null
var
setup
=
function
(
_options
)
{
var
options
=
Sequelize
.
Utils
.
_
.
extend
({
path
:
__dirname
+
'/assets/migrations'
},
_options
||
{})
Helpers
.
async
(
function
(
done
)
{
var
options
=
Sequelize
.
Utils
.
_
.
extend
({
path
:
__dirname
+
'/assets/migrations'
},
_options
||
{})
migrator
=
new
Migrator
(
sequelize
,
options
)
migrator
=
new
Migrator
(
sequelize
,
options
)
migrator
.
findOrCreateSequelizeMetaModel
({
force
:
true
}).
success
(
function
(
_SequelizeMeta
)
{
SequelizeMeta
=
_SequelizeMeta
done
()
})
})
}
beforeEach
(
function
()
{
migrator
=
null
})
...
...
@@ -71,10 +78,12 @@ describe('Migrator', function() {
setup
()
Helpers
.
async
(
function
(
done
)
{
migrator
.
getUndoneMigrations
(
function
(
files
)
{
expect
(
files
.
length
).
toEqual
(
1
)
expect
(
files
[
0
]).
toEqual
(
'20111123060700-addBirthdateToPerson.js'
)
done
()
SequelizeMeta
.
create
({
lastMigrationId
:
'20111117063700'
}).
success
(
function
()
{
migrator
.
getUndoneMigrations
(
function
(
files
)
{
expect
(
files
.
length
).
toEqual
(
1
)
expect
(
files
[
0
]).
toEqual
(
'20111123060700-addBirthdateToPerson.js'
)
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