@mands/nx-playwright
Advanced tools
Comparing version 0.5.0 to 0.5.1
{ | ||
"name": "@mands/nx-playwright", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -165,2 +165,55 @@ import { addProjectConfiguration, readJson, updateWorkspaceConfiguration } from '@nrwl/devkit'; | ||
}); | ||
it('generates correct .eslintrc.json', async () => { | ||
const host = createTree(); | ||
await generator(host, { | ||
name: 'test-generator', | ||
linter: Linter.EsLint, | ||
project: 'test-project', | ||
}); | ||
const eslintJson = readJson(host, 'e2e/test-generator/.eslintrc.json'); | ||
expect(eslintJson).toEqual({ | ||
extends: ['../../.eslintrc.json'], | ||
ignorePatterns: ['!**/*'], | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx', '*.js', '*.jsx'], | ||
rules: { 'jest/no-done-callback': 'off' }, | ||
}, | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
rules: { 'jest/no-done-callback': 'off' }, | ||
}, | ||
{ | ||
files: ['*.js', '*.jsx'], | ||
rules: {}, | ||
}, | ||
], | ||
}); | ||
}); | ||
it('adds an override for AXE tests to .eslintrc.json when includeAxe option is present', async () => { | ||
const host = createTree(); | ||
await generator(host, { | ||
name: 'test-generator', | ||
linter: Linter.EsLint, | ||
project: 'test-project', | ||
includeAxe: true, | ||
}); | ||
const eslintJson = readJson(host, 'e2e/test-generator/.eslintrc.json'); | ||
expect(eslintJson).toEqual({ | ||
extends: ['../../.eslintrc.json'], | ||
ignorePatterns: ['!**/*'], | ||
overrides: expect.arrayContaining([ | ||
{ | ||
files: ['**/axe-tests/axe-tests.spec.ts'], | ||
rules: { 'jest/expect-expect': 'off' }, | ||
}, | ||
]), | ||
}); | ||
}); | ||
}); | ||
@@ -167,0 +220,0 @@ |
@@ -19,6 +19,14 @@ "use strict"; | ||
(0, devkit_1.updateJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, '.eslintrc.json'), (json) => { | ||
const overrides = json.overrides.map(({ files, rules }) => files.includes('*.ts') | ||
const baseOverrides = json.overrides.map(({ files, rules }) => files.includes('*.ts') | ||
? { files, rules: { 'jest/no-done-callback': 'off' } } | ||
: { files, rules }); | ||
return Object.assign(Object.assign({}, json), { overrides, extends: [...json.extends] }); | ||
return Object.assign(Object.assign({}, json), { overrides: options.includeAxe | ||
? [ | ||
...baseOverrides, | ||
{ | ||
files: ['**/axe-tests/axe-tests.spec.ts'], | ||
rules: { 'jest/expect-expect': 'off' }, | ||
}, | ||
] | ||
: baseOverrides, extends: [...json.extends] }); | ||
}); | ||
@@ -25,0 +33,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
58362
1146
1