-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from mate-academy/jest-mochawesome-reporter
[Jest]: Added initial code for jest-mochawesome-reporter
- Loading branch information
Showing
11 changed files
with
6,098 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
/node_modules | ||
/dist |
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,35 @@ | ||
const resolve = { | ||
extensions: ['.js', '.ts'], | ||
}; | ||
|
||
module.exports = { | ||
extends: [ | ||
'@mate-academy/eslint-config-internal', | ||
], | ||
env: { | ||
node: true, | ||
mocha: true, | ||
}, | ||
rules: { | ||
// note you must disable the base rule as it can report incorrect errors | ||
'no-redeclare': 'off', | ||
// note you must disable the base rule as it can report incorrect errors | ||
'no-shadow': 'off', | ||
camelcase: 'off', | ||
'class-methods-use-this': 'off', | ||
'no-console': 'off', | ||
'no-restricted-syntax': 'off', | ||
'no-underscore-dangle': 'off', | ||
}, | ||
ignorePatterns: [ | ||
'**/node_modules/*', | ||
'**/dist/*', | ||
], | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: resolve.extensions, | ||
}, | ||
}, | ||
}, | ||
}; |
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,15 @@ | ||
# IDE | ||
.idea | ||
.vscode | ||
|
||
# Node | ||
node_modules | ||
|
||
# MacOS | ||
.DS_Store | ||
|
||
# Generated files | ||
dist | ||
|
||
# Environment | ||
.env |
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 @@ | ||
v18 |
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,42 @@ | ||
# `@mate-academy/jest-mochawesome-reporter` npm package | ||
|
||
## Description | ||
|
||
This package is a reporter for Jest that generates a report in mochawesome compatible JSON format. You can use it with [mochawesome](https://www.npmjs.com/package/mochawesome) to show a fancy report in HTML format. | ||
|
||
## Install | ||
- `npm i -D @mate-academy/jest-mochawesome-reporter` | ||
|
||
## Usage | ||
- add `@mate-academy/jest-mochawesome-reporter` to `jest.config.js`: | ||
|
||
```js | ||
module.exports = { | ||
... | ||
reporters: [ | ||
'default', // to see console output | ||
'@mate-academy/jest-mochawesome-reporter' | ||
], | ||
... | ||
}; | ||
``` | ||
- configuration is optional, default values: | ||
|
||
```js | ||
module.exports = { | ||
... | ||
reporters: [ | ||
'default', | ||
[ | ||
'@mate-academy/jest-mochawesome-reporter', | ||
{ | ||
outputDir: '<globalConfig.rootDir>', // rootDir from jest.config.js | ||
outputName: 'jest-mochawesome', | ||
createDirIfMissing: false, | ||
}, | ||
], | ||
], | ||
... | ||
}; | ||
``` | ||
|
Oops, something went wrong.