Skip to content

Commit

Permalink
add test for list without migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
okv committed Sep 3, 2019
1 parent fffa9ab commit 742e3f2
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* IMPORTANT
* This snapshot file is auto-generated, but designed for humans.
* It should be checked into source control and tracked carefully.
* Re-generate by setting TAP_SNAPSHOT=1 and running tests.
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/02-snapshot/bin/east/commands/list/withoutMigrations.js TAP > output 1`] = `
there is no new migrations
`
49 changes: 49 additions & 0 deletions test/02-snapshot/bin/east/commands/list/withoutMigrations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict';

const tap = require('tap');
const expect = require('expect.js');
const testUtils = require('../../../../../../testUtils');

tap.mochaGlobals();

const binPath = testUtils.getBinPath('east');
const describeTitle = 'bin/east list without migrations';

describe(describeTitle, () => {
let commandResult;
let migrator;

before(() => {
return Promise.resolve()
.then(() => testUtils.createMigrator({init: true}))
.then((createdMigrator) => {
migrator = createdMigrator;
});
});

after(() => testUtils.destroyMigrator({migrator}));

it('should be done without error', () => {
const cwd = testUtils.getTestDirPath();

return Promise.resolve()
.then(() => {
return testUtils.execAsync(
`"${binPath}" list`,
{cwd}
);
})
.then((result) => {
expect(result.stderr).not.ok();

commandResult = result;
});
});

it('stdout should match expected snapshot', () => {
tap.matchSnapshot(
testUtils.cleanSnapshotData(commandResult.stdout),
'output'
);
});
});

0 comments on commit 742e3f2

Please sign in to comment.