@naturalcycles/dev-lib 13.46.1 → 13.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cfg/jest.config.js
CHANGED
|
@@ -128,7 +128,7 @@ module.exports = {
|
|
|
128
128
|
outputDirectory: './tmp/jest',
|
|
129
129
|
outputName: 'unit.xml',
|
|
130
130
|
suiteNameTemplate: '{filepath}',
|
|
131
|
-
classNameTemplate: '{classname}',
|
|
131
|
+
classNameTemplate: '{filename} - {classname}',
|
|
132
132
|
titleTemplate: '{title}',
|
|
133
133
|
ancestorSeparator: ' ',
|
|
134
134
|
},
|
|
@@ -144,6 +144,25 @@ if (fs.existsSync(`./e2e`)) {
|
|
|
144
144
|
})
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
// /playwright
|
|
148
|
+
if (fs.existsSync(`./playwright`)) {
|
|
149
|
+
const eslintConfigPathE2e =
|
|
150
|
+
['./playwright/.eslintrc.js', './.eslintrc.js'].find(p => fs.existsSync(p)) ||
|
|
151
|
+
`${cfgDir}/eslint.config.js`
|
|
152
|
+
|
|
153
|
+
Object.assign(linters, {
|
|
154
|
+
// eslint, Prettier
|
|
155
|
+
'./playwright/**/*.{ts,tsx}': match => {
|
|
156
|
+
const filesList = micromatch.not(match, lintExclude).join(' ')
|
|
157
|
+
if (!filesList) return []
|
|
158
|
+
return [
|
|
159
|
+
`${eslintCmd} --config ${eslintConfigPathE2e} --parser-options=project:./playwright/tsconfig.json`,
|
|
160
|
+
prettierCmd,
|
|
161
|
+
].map(s => `${s} ${filesList}`)
|
|
162
|
+
},
|
|
163
|
+
})
|
|
164
|
+
}
|
|
165
|
+
|
|
147
166
|
function canRunBinary(name) {
|
|
148
167
|
try {
|
|
149
168
|
execSync(`which ${name}`)
|
|
@@ -29,9 +29,12 @@ async function eslintAllCommand() {
|
|
|
29
29
|
`${paths_cnst_1.cfgDir}/eslint.config.js`;
|
|
30
30
|
const eslintConfigPathE2e = ['./e2e/.eslintrc.js', './.eslintrc.js'].find(p => node_fs_1.default.existsSync(p)) ||
|
|
31
31
|
`${paths_cnst_1.cfgDir}/eslint.config.js`;
|
|
32
|
+
const eslintConfigPathPlaywright = ['./playwright/.eslintrc.js', './.eslintrc.js'].find(p => node_fs_1.default.existsSync(p)) ||
|
|
33
|
+
`${paths_cnst_1.cfgDir}/eslint.config.js`;
|
|
32
34
|
// const tsconfigPath = getTSConfigPath()
|
|
33
35
|
const tsconfigPathScripts = (0, lint_util_1.getTSConfigPathScripts)();
|
|
34
36
|
const tsconfigPathE2e = `./e2e/tsconfig.json`;
|
|
37
|
+
const tsconfigPathPlaywright = `./playwright/tsconfig.json`;
|
|
35
38
|
// todo: run on other dirs too, e.g pages, components, layouts
|
|
36
39
|
if (fix) {
|
|
37
40
|
await Promise.all([
|
|
@@ -41,6 +44,8 @@ async function eslintAllCommand() {
|
|
|
41
44
|
(0, lint_util_1.runESLintAsync)(`./scripts`, eslintConfigPathScripts, tsconfigPathScripts, undefined, fix),
|
|
42
45
|
// /e2e
|
|
43
46
|
(0, lint_util_1.runESLintAsync)(`./e2e`, eslintConfigPathE2e, tsconfigPathE2e, undefined, fix),
|
|
47
|
+
// /playwright
|
|
48
|
+
(0, lint_util_1.runESLintAsync)(`./playwright`, eslintConfigPathPlaywright, tsconfigPathPlaywright, undefined, fix),
|
|
44
49
|
]);
|
|
45
50
|
}
|
|
46
51
|
else {
|
|
@@ -51,6 +56,8 @@ async function eslintAllCommand() {
|
|
|
51
56
|
await (0, lint_util_1.runESLintAsync)(`./scripts`, eslintConfigPathScripts, tsconfigPathScripts, undefined, fix);
|
|
52
57
|
// /e2e
|
|
53
58
|
await (0, lint_util_1.runESLintAsync)(`./e2e`, eslintConfigPathE2e, tsconfigPathE2e, undefined, fix);
|
|
59
|
+
// /e2e
|
|
60
|
+
await (0, lint_util_1.runESLintAsync)(`./playwright`, eslintConfigPathPlaywright, tsconfigPathPlaywright, undefined, fix);
|
|
54
61
|
}
|
|
55
62
|
console.log(`${(0, nodejs_lib_1.boldGrey)('eslint-all')} ${(0, nodejs_lib_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
|
|
56
63
|
}
|