mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-04 11:52:39 +02:00
refactor: migrate lqip-loader to TS, fix typing for Webpack Loaders (#5779)
This commit is contained in:
parent
ca5d70d7fb
commit
68c970175a
18 changed files with 254 additions and 265 deletions
|
@ -10,14 +10,14 @@ import Vibrant from 'node-vibrant';
|
|||
import {Palette} from 'node-vibrant/lib/color';
|
||||
|
||||
import {toPalette, toBase64} from '../utils';
|
||||
import lqip from '../lqip';
|
||||
import * as lqip from '../lqip';
|
||||
|
||||
describe('lqip-loader', () => {
|
||||
describe('toBase64', () => {
|
||||
test('should return a properly formatted Base64 image string', () => {
|
||||
const expected = 'data:image/jpeg;base64,hello world';
|
||||
const expected = 'data:image/jpeg;base64,aGVsbG8gd29ybGQ=';
|
||||
const mockedMimeType = 'image/jpeg';
|
||||
const mockedBase64Data = 'hello world';
|
||||
const mockedBase64Data = Buffer.from('hello world');
|
||||
expect(toBase64(mockedMimeType, mockedBase64Data)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue