Skip to content

Commit

Permalink
fix: use make dir instead of mkdirp (#481)
Browse files Browse the repository at this point in the history
* fix: use make dir

* fix: flow
  • Loading branch information
bokuweb authored Feb 2, 2024
1 parent c6f6aa5 commit 9d03e2e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 14
node-version: 16
- name: yarn
run: yarn --frozen-lockfile
- name: flow
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"screenshot": "node test/screenshot.js",
"test:cli": "chmod +x dist/cli.js && ava test/cli.test.js",
"test:screenshot": "npm run build:report && npm run reg && npm run screenshot",
"test": "cross-env NODE_ENV=\"debug\" npm run build:report && npm run build && npm run test:cli && npm run test:screenshot"
"test": "cross-env NODE_ENV=\"debug\" npm run build:report && npm run build && npm run test:cli && npm run test:screenshot"
},
"engines": {
"node": ">=12"
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ type RegParams = {
expectedDir: string,
diffDir: string,
report?: string,
junitReport?: string,
json?: string,
update?: boolean,
extendedErrors?: boolean,
urlPrefix?: string,
matchingThreshold?: number,
threshold?: number, // alias to thresholdRate.
Expand Down Expand Up @@ -197,7 +199,7 @@ module.exports = (params: RegParams) => {
diffDir,
report: report || '',
junitReport: junitReport || '',
extendedErrors,
extendedErrors: !!extendedErrors,
urlPrefix: urlPrefix || '',
enableClientAdditionalDetection: !!enableClientAdditionalDetection,
});
Expand Down
3 changes: 2 additions & 1 deletion src/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import Mustache from 'mustache';
import * as detectDiff from 'x-img-diff-js';
import fs from 'fs';
import mkdirp from 'mkdirp';
import mkdirp from 'make-dir'; // $FlowIgnore
import path from 'path';
// $FlowIgnore
import * as xmlBuilder from 'xmlbuilder2';

export type ReportParams = {
Expand Down
2 changes: 1 addition & 1 deletion test/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const server = http.createServer((req, res) => {

server.listen(3000);

const mkdirp = require('mkdirp');
const mkdirp = require('make-dir');

const puppeteer = require('puppeteer');

Expand Down

0 comments on commit 9d03e2e

Please sign in to comment.