Skip to content

Commit e782ad7

Browse files
committed
fix report-test-files-ua.js skip-check option flag
1 parent 7027622 commit e782ad7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/tools/report-test-files-ua.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const readline = require('readline');
22
const { Command } = require('commander');
33
const YAML = require('js-yaml');
4+
const path = require('path');
45

56
const fs = require('fs');
67
const DeviceDetector = require('./../../index');
@@ -50,7 +51,8 @@ const parserLog = (folderTestPath, folderFixturePath, options) => {
5051
});
5152

5253
const aggregateNewUa = new AggregateNewUa({
53-
folderFixturePath, uniqueOutput
54+
folderFixturePath: path.resolve(folderFixturePath) + '/',
55+
uniqueOutput
5456
});
5557

5658
const reportFixture = (useragent, detectResult, clientHintData, clientHintJson) => {
@@ -135,7 +137,8 @@ const parserLog = (folderTestPath, folderFixturePath, options) => {
135137
clientHintJson.hints ?? clientHintJson,
136138
clientHintJson.meta ?? clientHintJson
137139
);
138-
const check = !options.skipCheck ? aggregateNewUa.check(useragent) : true;
140+
141+
const check = String(options.skipCheck) === '0' ? aggregateNewUa.check(useragent) : true;
139142
const detectResult = detector.detect(useragent, clientHintData);
140143

141144
if (check && formatOutput === FORMAT_OUTPUT_STRING) {

0 commit comments

Comments
 (0)