mirror of
https://github.com/knex/knex.git
synced 2025-07-23 00:42:45 +00:00
35 lines
916 B
JavaScript
35 lines
916 B
JavaScript
![]() |
const Knex = require('../../../lib/index');
|
||
|
const { expect } = require('chai');
|
||
|
const sqliteConfig = require('../../knexfile').sqlite3;
|
||
|
const FsMigrations = require('../../../lib/migrate/sources/fs-migrations')
|
||
|
.default;
|
||
|
|
||
|
describe('Migrator', () => {
|
||
|
describe('does not use postProcessResponse for internal queries', (done) => {
|
||
|
let migrationSource;
|
||
|
let knex;
|
||
|
before(() => {
|
||
|
migrationSource = new FsMigrations('test/unit/migrate/migrations/');
|
||
|
knex = Knex({
|
||
|
...sqliteConfig,
|
||
|
migrationSource,
|
||
|
postProcessResponse: () => {
|
||
|
throw new Error('Response was processed');
|
||
|
},
|
||
|
});
|
||
|
});
|
||
|
|
||
|
it('latest', (done) => {
|
||
|
expect(() => {
|
||
|
knex.migrate
|
||
|
.latest({
|
||
|
directory: 'test/unit/migrate/migrations',
|
||
|
})
|
||
|
.then(() => {
|
||
|
done();
|
||
|
});
|
||
|
}).not.to.throw();
|
||
|
});
|
||
|
});
|
||
|
});
|