feat: publish av-tools 0.2.0
This commit is contained in:
31
tests/unit/bundled-font-assets.test.ts
Normal file
31
tests/unit/bundled-font-assets.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { createHash } from 'node:crypto';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { BUNDLED_CONTACT_SHEET_FONT } from '../../src/assets/bundled-font';
|
||||
|
||||
describe('bundled contact-sheet font', () => {
|
||||
it('matches its reviewed byte identity and ships the embedded licence', () => {
|
||||
const bytes = readFileSync(
|
||||
resolve(
|
||||
process.cwd(),
|
||||
'public/fonts',
|
||||
BUNDLED_CONTACT_SHEET_FONT.fileName
|
||||
)
|
||||
);
|
||||
expect(bytes.byteLength).toBe(BUNDLED_CONTACT_SHEET_FONT.byteLength);
|
||||
expect(createHash('sha256').update(bytes).digest('hex')).toBe(
|
||||
BUNDLED_CONTACT_SHEET_FONT.sha256
|
||||
);
|
||||
|
||||
const licence = readFileSync(
|
||||
resolve(process.cwd(), BUNDLED_CONTACT_SHEET_FONT.licenseFile),
|
||||
'utf8'
|
||||
);
|
||||
expect(licence).toContain('Bitstream Vera Fonts Copyright');
|
||||
expect(licence).toContain('Arev Fonts Copyright');
|
||||
expect(licence).toContain(
|
||||
'The above copyright and trademark notices and this permission notice'
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user