mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 02:08:55 +02:00
* Fix CSS tests * Revamp * - * fix failing test * add test for minifyCss with fixtures & snapshot * remove unintended addition * simplify the test.css
24 lines
713 B
JavaScript
24 lines
713 B
JavaScript
/**
|
|
* Copyright (c) 2017-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
const utils = require('../utils');
|
|
|
|
describe('server utils', () => {
|
|
test('minify css', () => {
|
|
const testCss = fs.readFileSync(
|
|
path.join(__dirname, '__fixtures__', 'test.css'),
|
|
'utf8'
|
|
);
|
|
const notCss = fs.readFileSync(
|
|
path.join(__dirname, '__fixtures__', 'test.md'),
|
|
'utf8'
|
|
);
|
|
utils.minifyCss(testCss).then(css => expect(css).toMatchSnapshot());
|
|
utils.minifyCss(notCss).catch(e => expect(e).toMatchSnapshot());
|
|
});
|
|
});
|