forked from timgit/pg-boss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexportTest.js
27 lines (21 loc) · 839 Bytes
/
exportTest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const assert = require('assert')
const PgBoss = require('../')
const currentSchemaVersion = require('../version.json').schema
describe('export', function () {
it('should export commands to manually build schema', function () {
const schema = 'custom'
const plans = PgBoss.getConstructionPlans(schema)
assert(plans.includes(`${schema}.job`))
assert(plans.includes(`${schema}.version`))
})
it('should export commands to migrate', function () {
const schema = 'custom'
const plans = PgBoss.getMigrationPlans(schema, currentSchemaVersion - 1)
assert(plans, 'migration plans not found')
})
it('should export commands to roll back', function () {
const schema = 'custom'
const plans = PgBoss.getRollbackPlans(schema, currentSchemaVersion)
assert(plans, 'rollback plans not found')
})
})