Skip to content

Commit

Permalink
🔀 Merge pull request #554 from FrostCo/additional_tests
Browse files Browse the repository at this point in the history
Additional tests
  • Loading branch information
richardfrost authored May 9, 2024
2 parents 7718245 + c47b9ab commit 46bf194
Show file tree
Hide file tree
Showing 12 changed files with 754 additions and 16 deletions.
253 changes: 253 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"release": "npm run release:build",
"test:addon": "npm run build --environment=test --target=firefox-mv2 && npx addons-linter ./dist",
"test:all": "npm run test && npm run test:lint:tests",
"test:cov": "nyc --reporter=lcov --reporter=text npm run test:nocov",
"test:cov": "nyc --reporter=lcov --reporter=html --reporter=text npm run test:nocov",
"test:debug": "node --inspect-brk node_modules/mocha/bin/_mocha --paths --reporter tap",
"test:lint:all": "npm run test:lint && npm run test:lint:bin && npm run test:lint:tests",
"test:lint:bin": "eslint \"bin/**/*.*js\"",
Expand Down Expand Up @@ -86,6 +86,7 @@
"mocha": "^10.2.0",
"npm-check-updates": "^16.14.12",
"nyc": "^15.1.0",
"sinon": "^17.0.2",
"terser-webpack-plugin": "^5.3.10",
"ts-loader": "^9.5.1",
"tsconfig-paths": "^4.2.0",
Expand Down
10 changes: 2 additions & 8 deletions src/script/lib/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,8 @@ export default class Filter {
sub = sub.replace(`\\${i + 1}`, this.cfg.preserveCase ? captureGroup : captureGroup.toLowerCase());
});

// Only return if something was substituted
if (sub !== word.sub) {
if (this.cfg.substitutionMark) {
sub = '[' + sub + ']';
}

return sub;
}
if (this.cfg.substitutionMark) sub = '[' + sub + ']';
return sub;
}

// Make substitution match case of original match
Expand Down
Loading

0 comments on commit 46bf194

Please sign in to comment.