chore(v2): upgrade dependencies + require Node 12 (#4223)

* chore(v2): upgrade dependencies

* Set minimum Node.js version to 12.13

* Fix test

* Upgrade copy-text-to-clipboard

* Bump Node versions

* Update .nvmrc

* mark cacheTime as forbidded field

* Downgrade jest to v25.2.7

* Increase Node version for Windows CI

* Test fix

* Attempt to fix Windows CI

* Downgrade execa

* fix async test errors

* Upgrade execa

Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
Alexey Pyltsyn 2021-02-18 17:12:42 +03:00 committed by GitHub
parent 02f7722f2e
commit f13448d5e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 2097 additions and 1840 deletions

View file

@ -49,22 +49,19 @@ describe('lqip-loader', () => {
const imgPath = path.join(__dirname, '__fixtures__', 'endi.jpg');
const invalidPath = path.join(__dirname, '__fixtures__', 'docusaurus.svg');
it('should reject unknown or unsupported file format', () => {
expect(lqip.base64(invalidPath)).rejects.toBeTruthy();
it('should reject unknown or unsupported file format', async () => {
await expect(lqip.base64(invalidPath)).rejects.toBeTruthy();
});
it('should generate a valid base64', () => {
it('should generate a valid base64', async () => {
const expectedBase64 = 'data:image/jpeg;base64,/9j/2wBDA';
lqip.base64(imgPath).then((base64: string) => {
expect(base64).toContain(expectedBase64);
});
await expect(lqip.base64(imgPath)).resolves.toContain(expectedBase64);
});
it('should generate a valid color palette', () => {
lqip.palette(imgPath).then((imgPalette: string[]) => {
expect(imgPalette).toHaveLength(6);
expect(imgPalette).toContain('#578ca1');
});
it('should generate a valid color palette', async () => {
const imgPalette = await lqip.palette(imgPath);
expect(imgPalette).toHaveLength(6);
expect(imgPalette).toContain('#578ca1');
});
});
});