Sign In

@testgorilla/eslint-plugin-e2e

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@testgorilla/eslint-plugin-e2e - npm Package Compare versions

Comparing version
0.1.1
to
0.1.2
+45
lib/rules/no-hardcoded-test-emails.js
/**
* Disallow hardcoded `dummy.tests+` email literals in specs.
*
* Generated identities must come from the `rand*Email` generators
* (`@testgorilla/e2e-framework/config`) so every row created on the shared
* staging database carries the run marker the purge jobs select on
* (.github/instructions/07-test-data.md). Fixture addresses that genuinely must be
* static belong in a named const (helpers/config or @testgorilla/e2e-assets),
* not inline in a spec.
*/
const MARKER = 'dummy.tests+';
const MESSAGE =
`Hardcoded "${MARKER}…" email. Mint identities with randCandidateEmail/randCustomerEmail/` +
'randTeamMemberEmail (run-marked, purgeable), or reference a named const for static fixtures.';
module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow hardcoded dummy.tests+ email literals in specs',
},
schema: [],
messages: {
hardcodedTestEmail: MESSAGE,
},
},
create(context) {
const check = (node, value) => {
if (typeof value === 'string' && value.includes(MARKER)) {
context.report({ node, messageId: 'hardcodedTestEmail' });
}
};
return {
Literal(node) {
check(node, node.value);
},
TemplateElement(node) {
check(node, node.value && node.value.cooked);
},
};
},
};
+2
-0
const requireTagInTests = require('./lib/rules/require-tag-in-tests');
const validateTestCaseTickets = require('./lib/rules/validate-test-case-tickets');
const exclusiveTriageTags = require('./lib/rules/exclusive-triage-tags');
const noHardcodedTestEmails = require('./lib/rules/no-hardcoded-test-emails');

@@ -10,3 +11,4 @@ module.exports = {

'exclusive-triage-tags': exclusiveTriageTags,
'no-hardcoded-test-emails': noHardcodedTestEmails,
},
};
+1
-1
{
"name": "@testgorilla/eslint-plugin-e2e",
"version": "0.1.1",
"version": "0.1.2",
"description": "TestGorilla e2e test conventions: tag enforcement, JIRA ticket validation (cross-repo aware), triage-tag exclusivity. Extracted from tgo-qa-automation's eslint-plugin-custom for reuse by repos that collocate their e2e suites.",

@@ -5,0 +5,0 @@ "license": "UNLICENSED",

@@ -48,4 +48,4 @@ # @testgorilla/eslint-plugin-e2e

tgo-qa-automation continues to use its local `eslint-plugin-custom` until the
planned switch (a follow-up alongside the import-path cleanup).
tgo-qa-automation uses this plugin as its active lint plugin (file:-installed
from the workspace); `eslint-plugin-custom` has been retired (QA-3745).

@@ -52,0 +52,0 @@ ## Develop