forked from webpro-nl/knip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webpro-nl#798 exclude built-in cypress reporters from dependency check
- Loading branch information
1 parent
69c021b
commit 49ab5ce
Showing
10 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
packages/knip/fixtures/plugins/cypress-builtin-reporter/cypress.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'; | ||
import { defineConfig } from 'cypress'; | ||
|
||
const cypressJsonConfig = {}; | ||
|
||
export default defineConfig({ | ||
reporter: "junit", | ||
e2e: { | ||
...nxE2EPreset(__dirname, {}), | ||
...cypressJsonConfig, | ||
}, | ||
}); |
7 changes: 7 additions & 0 deletions
7
packages/knip/fixtures/plugins/cypress-builtin-reporter/cypress/support/commands.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { faker } from '@faker-js/faker'; | ||
|
||
function login() { | ||
return faker; | ||
} | ||
|
||
Cypress.Commands.add('login', login); |
2 changes: 2 additions & 0 deletions
2
packages/knip/fixtures/plugins/cypress-builtin-reporter/cypress/support/e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import '@testing-library/cypress/add-commands'; | ||
import './commands'; |
1 change: 1 addition & 0 deletions
1
...res/plugins/cypress-builtin-reporter/node_modules/@nrwl/cypress/plugins/cypress-preset.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages/knip/fixtures/plugins/cypress-builtin-reporter/node_modules/cypress/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
packages/knip/fixtures/plugins/cypress-builtin-reporter/node_modules/cypress/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
packages/knip/fixtures/plugins/cypress-builtin-reporter/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@fixtures/cypress", | ||
"devDependencies": { | ||
"cypress": "*", | ||
"cypress-multi-reporters": "*", | ||
"mocha-junit-reporter": "*", | ||
"mochawesome": "*" | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/knip/fixtures/plugins/cypress-builtin-reporter/reporter-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"reporterEnabled": "mochawesome, mocha-junit-reporter , @testing-library/my-fake-reporter" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/knip/test/plugins/cypress-builtin-reporter.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { test } from 'bun:test'; | ||
import assert from 'node:assert/strict'; | ||
import { main } from '../../src/index.js'; | ||
import { resolve } from '../../src/util/path.js'; | ||
import baseArguments from '../helpers/baseArguments.js'; | ||
|
||
const cwd = resolve('fixtures/plugins/cypress-multi-reporter'); | ||
|
||
test('Exclude built-in cypress reporters from dependency checks', async () => { | ||
const { issues, counters } = await main({ | ||
...baseArguments, | ||
cwd, | ||
}); | ||
|
||
assert(!issues.unlisted['cypress.config.ts']['junit']); | ||
}); |