22 lines
717 B
JavaScript
22 lines
717 B
JavaScript
const { render, renderInstructions } = require('./index');
|
|
const { colors } = require('../../colors-default');
|
|
|
|
describe('render', () => {
|
|
it('should render properly formatted .sketchpalette files', done => {
|
|
Promise.all(render(colors)).then(files => {
|
|
expect(files.length).toBe(2);
|
|
files.forEach(file => {
|
|
expect(file.contents.toString('utf8')).toMatchSnapshot();
|
|
});
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('renderInstructions', () => {
|
|
it('should provide installation instructions', async () => {
|
|
const files = await Promise.all(render(colors));
|
|
const instructions = renderInstructions(files.map(({ name }) => name));
|
|
expect(instructions).toMatchSnapshot();
|
|
});
|
|
}) |