mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +02:00
Fix CSS tests (#839)
* Fix CSS tests * Revamp * - * fix failing test * add test for minifyCss with fixtures & snapshot * remove unintended addition * simplify the test.css
This commit is contained in:
parent
8cd4b4fca6
commit
4267337fb0
9 changed files with 178 additions and 88 deletions
24
lib/server/__tests__/utils.test.js
Normal file
24
lib/server/__tests__/utils.test.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* 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());
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue