Skip to content

Commit

Permalink
chore: upgrade filenamify-url
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickshan committed Jul 25, 2024
1 parent 065af8c commit 89d4189
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const path = require('path');
const serveIndex = require('serve-index');
const fs = require('fs');
const bodyParser = require('body-parser');
const filenamifyUrl = require('filenamify-url');
const mkdirp = require('mkdirp');
const proxy = require('./proxy');

Expand Down Expand Up @@ -44,7 +43,9 @@ const metadataFolder = '../tmp/reftests/metadata';
mkdirp.sync(path.resolve(__dirname, screenshotFolder));
mkdirp.sync(path.resolve(__dirname, metadataFolder));

const writeScreenshot = (buffer: Buffer, body: ScreenshotRequest) => {
const writeScreenshot = async (buffer: Buffer, body: ScreenshotRequest) => {
const { default: filenamifyUrl } = await import('filenamify-url');

const filename = `${filenamifyUrl(body.test.replace(/^\/tests\/reftests\//, '').replace(/\.html$/, ''), {
replacement: '-'
})}!${[process.env.TARGET_BROWSER, body.platform.name, body.platform.version].join('-')}`;
Expand Down

0 comments on commit 89d4189

Please sign in to comment.