-
Notifications
You must be signed in to change notification settings - Fork 8
/
MigratRunList.js
21 lines (20 loc) · 1016 Bytes
/
MigratRunList.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var _ = require('lodash');
var assert = require('chai').assert;
var MigratRunList = require('../lib/MigratRunList.js');
var MigratMigration = require('../lib/MigratMigration.js');
describe('MigratRunList', function() {
describe('.push()', function() {
it('should throw if "migration" argument invalid', function() {
var runlist = new MigratRunList();
assert.throws(function() { runlist.push('up'); }, /Migration not a MigratMigration instance/);
assert.throws(function() { runlist.push('up', null); }, /Migration not a MigratMigration instance/);
assert.throws(function() { runlist.push('up', {}); }, /Migration not a MigratMigration instance/);
});
it('should throw if "method" argument invalid', function() {
var migration = new MigratMigration();
var runlist = new MigratRunList();
assert.throws(function() { runlist.push(null, migration); }, /Invalid migration method/);
assert.throws(function() { runlist.push('invalid', migration); }, /Invalid migration method/);
});
});
});