Skip to content

Commit

Permalink
Merge pull request #934 from macbre/dependabot/npm_and_yarn/prettier-…
Browse files Browse the repository at this point in the history
…2.3.0
  • Loading branch information
dependabot[bot] authored May 11, 2021
2 parents 2f03517 + 5204459 commit 229f4d7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
3 changes: 2 additions & 1 deletion lib/metadata/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ function getModuleMetadata(moduleFile) {
},
matches,
moduleName,
metricRegEx = /(setMetric|setMetricEvaluate|incrMetric)\(['"]([^'"]+)['"](\)|,)(.*@desc.*$)?/gm,
metricRegEx =
/(setMetric|setMetricEvaluate|incrMetric)\(['"]([^'"]+)['"](\)|,)(.*@desc.*$)?/gm,
eventsRegEx = /emit\(['"]([^'"]+)['"]([^)]+).*@desc(.*)$/gm;

data.name = moduleName = moduleFile.split("/").pop().replace(/\.js$/, "");
Expand Down
3 changes: 2 additions & 1 deletion modules/staticAssets/staticAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ module.exports = function (phantomas) {
assetsReqCounter = new Collection(),
cookieDomains = new Collection(),
// TODO: use 3pc database with tracking services
trackingUrls = /google-analytics.com\/__utm.gif|pixel.quantserve.com\/pixel/;
trackingUrls =
/google-analytics.com\/__utm.gif|pixel.quantserve.com\/pixel/;

phantomas.setMetric("assetsNotGzipped"); // @desc number of static assets that were not gzipped
phantomas.setMetric("assetsWithQueryString"); // @desc number of static assets requested with query string (e.g. ?foo) in URL
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"eslint-plugin-node": "^11.1.0",
"glob": "^7.1.6",
"mockery": "^2.0.0",
"prettier": "2.2.1",
"prettier": "2.3.0",
"vows": "^0.8.3"
},
"scripts": {
Expand Down
31 changes: 19 additions & 12 deletions test/integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,29 @@ spec.forEach(function (test) {

// check metrics
Object.keys(test.metrics || {}).forEach(function (name) {
batch[batchName][
'should have "' + name + '" metric properly set'
] = function (err, results) {
assert.ok(!(err instanceof Error), "Error should not be thrown: " + err);
assert.strictEqual(results.getMetric(name), test.metrics[name]);
};
batch[batchName]['should have "' + name + '" metric properly set'] =
function (err, results) {
assert.ok(
!(err instanceof Error),
"Error should not be thrown: " + err
);
assert.strictEqual(results.getMetric(name), test.metrics[name]);
};
});

// check offenders
Object.keys(test.offenders || {}).forEach(function (name) {
batch[batchName][
'should have "' + name + '" offender(s) properly set'
] = function (err, results) {
assert.ok(!(err instanceof Error), "Error should not be thrown: " + err);
assert.deepStrictEqual(results.getOffenders(name), test.offenders[name]);
};
batch[batchName]['should have "' + name + '" offender(s) properly set'] =
function (err, results) {
assert.ok(
!(err instanceof Error),
"Error should not be thrown: " + err
);
assert.deepStrictEqual(
results.getOffenders(name),
test.offenders[name]
);
};
});

suite.addBatch(batch);
Expand Down

0 comments on commit 229f4d7

Please sign in to comment.