28 lines
815 B
JavaScript
Raw Normal View History

/*global describe, it, expect*/
'use strict';
2014-07-21 18:38:40 -04:00
var path = require('path');
var rimraf = require('rimraf');
module.exports = function(knex) {
describe('knex.seed.make', function() {
it('should create a new seed file with the make method', function () {
return knex.seed.make('test').then(function (name) {
rimraf.sync(path.dirname(name));
expect(path.basename(name)).to.equal('test.js');
2014-07-21 18:38:40 -04:00
});
});
});
2014-07-21 18:38:40 -04:00
describe('knex.seed.run', function() {
it('should run all seed files in the configured seed directory', function() {
2014-07-21 19:33:42 -04:00
return knex.seed.run({directory: 'test/integration/seed/test'}).spread(function(data) {
2014-07-21 19:30:06 -04:00
expect(path.basename(data[0])).to.equal('seed1.js');
expect(path.basename(data[1])).to.equal('seed2.js');
2014-07-21 18:38:40 -04:00
});
});
});
2014-07-21 18:38:40 -04:00
};