From b56d39c7c58ae9afc07f192e5893cbc0359540c0 Mon Sep 17 00:00:00 2001 From: Romain Menke Date: Sun, 25 Feb 2024 13:29:04 +0100 Subject: [PATCH] cleanup --- index.js | 2 -- test/_tape.cjs | 7 +++++++ test/hosted-fonts.ttf.expect.css | 12 ++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 test/hosted-fonts.ttf.expect.css diff --git a/index.js b/index.js index 80d3eb7..69eb1dc 100644 --- a/index.js +++ b/index.js @@ -435,8 +435,6 @@ function plugin(initialOptions) { if (fontFaces) { const asyncPath = path.resolve(process.cwd(), options.async) - console.log(asyncPath); - const asyncJs = '(function(){' + fs.readFileSync('loader.min.js', 'utf8') + diff --git a/test/_tape.cjs b/test/_tape.cjs index 65d9ca9..04021e3 100644 --- a/test/_tape.cjs +++ b/test/_tape.cjs @@ -111,6 +111,13 @@ postcssTape(plugin)({ hosted: ['./test/fonts'] } }, + 'hosted-fonts:ttf': { + message: "supports hosted fonts with ttf", + options: { + hosted: ['./test/fonts'], + formats: ['woff', 'ttf'] + } + }, 'hosted-fonts:custom-font-path': { message: "supports hosted fonts", options: { diff --git a/test/hosted-fonts.ttf.expect.css b/test/hosted-fonts.ttf.expect.css new file mode 100644 index 0000000..78ac884 --- /dev/null +++ b/test/hosted-fonts.ttf.expect.css @@ -0,0 +1,12 @@ +@font-face { + font-family: "Source Sans Pro"; + font-style: normal; + font-weight: 400; + src: url(fonts/pathFont.woff) format("woff"),url(fonts/pathFont.ttf) format("truetype") +} + +a { + font-family: "Source Sans Pro" +} + +b {}