* v1.11.1

* chore: publish new website

* misc: fix tests
This commit is contained in:
Yangshun Tay 2019-06-08 10:56:21 -07:00 committed by GitHub
parent b2fe2a65c8
commit 3496f6e609
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 802 additions and 485 deletions

View file

@ -27,7 +27,7 @@ jest.mock('../env', () => ({
}));
describe('server utils', () => {
test('minify css', () => {
test('minify css', async () => {
const testCss = fs.readFileSync(
path.join(__dirname, '__fixtures__', 'test.css'),
'utf8',
@ -36,17 +36,24 @@ describe('server utils', () => {
path.join(__dirname, '__fixtures__', 'test.md'),
'utf8',
);
utils.minifyCss(testCss).then(css => expect(css).toMatchSnapshot());
utils.minifyCss(notCss).catch(e => expect(e).toMatchSnapshot());
const css = await utils.minifyCss(testCss);
expect(css).toMatchSnapshot();
try {
await utils.minifyCss(notCss);
} catch (error) {
expect(error).toMatchSnapshot();
}
});
test('autoprefix css', () => {
test('autoprefix css', async () => {
const testCss = fs.readFileSync(
path.join(__dirname, '__fixtures__', 'test.css'),
'utf8',
);
utils.autoPrefixCss(testCss).then(css => expect(css).toMatchSnapshot());
const css = await utils.autoPrefixCss(testCss);
expect(css).toMatchSnapshot();
});
test('getLanguage', () => {