mirror of https://github.com/Seich/Beau.git
24 lines
571 B
JavaScript
24 lines
571 B
JavaScript
const ListCommand = require('../commands/list');
|
|
|
|
jest.mock('../../../src/shared');
|
|
|
|
jest.mock('../base');
|
|
|
|
describe('List Command', () => {
|
|
let result;
|
|
|
|
beforeEach(() => {
|
|
result = [];
|
|
jest.spyOn(process.stdout, 'write').mockImplementation(val =>
|
|
result.push(require('strip-ansi')(val.toString('utf8')))
|
|
);
|
|
});
|
|
|
|
afterEach(() => jest.restoreAllMocks());
|
|
|
|
test.each([[], ['--no-format']])('with flags:', async (...args) => {
|
|
await ListCommand.run(args);
|
|
expect(result).toMatchSnapshot();
|
|
});
|
|
});
|