Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
textlint-tester
Advanced tools
Mocha test helper library for textlint rule.
npm install -D textlint-tester
textlint-tester
{string} ruleName
ruleName is name of thee rule{Function} rule
rule is the function of rule{string[]|object[]} valid
["text", { text : "text" }]
{object[]} invalid
[{text: "text", errors: [ messages : "expected message" ]}
var TextLintTester = require("textlint-tester");
// rules
var noTodo = require("textlint-rule-no-todo");
var maxNumberOfLine = require("textlint-rule-max-number-of-lines");
var tester = new TextLintTester();
// ruleName, rule, expected[]
tester.run("no-todo", noTodo, {
valid: [
"string, test desu",
{
text: "日本語 is Japanese."
}
],
invalid: [
// text, expected errors
{
text: "- [ ] string",
errors: [
{message: "found TODO: '- [ ] string'"}
]
},
{
text: "TODO: string",
errors: [
{message: "found TODO: 'TODO: string'"}
]
}
]
});
tester.run("max-number-of-lines", maxNumberOfLine, {
valid: [
"string, test desu",
{
text: "日本語 is Japanese."
}
],
invalid: [
{
text: `1
2
3
`,
options: {
max: 2
},
errors: [
{
ruleId: "max-number-of-lines",
message: "Document is too long(number of lines: 3)."
}
]
}
]
});
mocha test/
# npm test
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT
FAQs
testing tool for textlint rule.
The npm package textlint-tester receives a total of 20,922 weekly downloads. As such, textlint-tester popularity was classified as popular.
We found that textlint-tester demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.