diff --git a/package.json b/package.json index e925c22..01e55fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hayes0724/web-font-converter", - "version": "1.0.4", + "version": "1.0.5", "main": "src/index.js", "license": "MIT", "author": "eric hayes ", diff --git a/tests/api-convert.test.js b/tests/api-convert.test.js index 37939f3..be93282 100644 --- a/tests/api-convert.test.js +++ b/tests/api-convert.test.js @@ -11,13 +11,15 @@ const createOutputDirectory = () => { } } +beforeAll(() => { + createOutputDirectory() +}) + +afterEach(() => { + fsExtra.emptyDirSync('./tests/output/') +}); + describe('TTF input font tests', () => { - beforeAll(() => { - createOutputDirectory() - }) - afterAll(() => { - fsExtra.emptyDirSync('./tests/output/') - }); test('convert ttf to woff', () => { convertFont(`${fileIn}.ttf`, `${fileOut}.woff`) const size = fs.statSync(`${fileOut}.woff`).size @@ -32,12 +34,6 @@ describe('TTF input font tests', () => { }) describe('OTF input font tests', () => { - beforeAll(() => { - createOutputDirectory() - }) - afterEach(() => { - fsExtra.emptyDirSync('./tests/output/') - }); test('convert otf to woff', () => { convertFont(`${fileIn}.otf`, `${fileOut}.woff`) const size = fs.statSync(`${fileOut}.woff`).size @@ -47,8 +43,8 @@ describe('OTF input font tests', () => { test('convert otf to woff2', () => { convertFont(`${fileIn}.otf`, `${fileOut}.woff2`) const size = fs.statSync(`${fileOut}.woff2`).size - expect(size).toBeGreaterThanOrEqual(35050); - expect(size).toBeLessThanOrEqual(35150); + expect(size).toBeGreaterThanOrEqual(35000); + expect(size).toBeLessThanOrEqual(35300); }); test('convert otf to ttf', () => { @@ -65,12 +61,6 @@ describe('OTF input font tests', () => { }) describe('SVG input font tests', () => { - beforeAll(() => { - createOutputDirectory() - }) - afterEach(() => { - fsExtra.emptyDirSync('./tests/output/') - }); test('convert svg to ttf', () => { convertFont(`${fileIn}.svg`, `${fileOut}.ttf`) const size = fs.statSync(`${fileOut}.ttf`).size @@ -87,6 +77,6 @@ describe('SVG input font tests', () => { convertFont(`${fileIn}.svg`, `${fileOut}.woff2`) const size = fs.statSync(`${fileOut}.woff2`).size expect(size).toBeGreaterThanOrEqual(35000); - expect(size).toBeLessThanOrEqual(35200); + expect(size).toBeLessThanOrEqual(35300); }); }) diff --git a/tests/api-fonts.test.js b/tests/api-fonts.test.js index 1262e5c..56ee1a3 100644 --- a/tests/api-fonts.test.js +++ b/tests/api-fonts.test.js @@ -43,8 +43,8 @@ describe('OTF input font tests', () => { test('convert otf to woff2', () => { fonts.otf.convert.woff2(`${fileIn}.otf`, `${fileOut}.woff2`) const size = fs.statSync(`${fileOut}.woff2`).size - expect(size).toBeGreaterThanOrEqual(35050); - expect(size).toBeLessThanOrEqual(35150); + expect(size).toBeGreaterThanOrEqual(35000); + expect(size).toBeLessThanOrEqual(35300); }); test('convert otf to ttf', () => { @@ -77,6 +77,6 @@ describe('SVG input font tests', () => { fonts.svg.convert.woff2(`${fileIn}.svg`, `${fileOut}.woff2`) const size = fs.statSync(`${fileOut}.woff2`).size expect(size).toBeGreaterThanOrEqual(35000); - expect(size).toBeLessThanOrEqual(35200); + expect(size).toBeLessThanOrEqual(35300); }); })