Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds danger-plugin-jest to the repo #388

Merged
merged 1 commit into from
Oct 14, 2017
Merged

Adds danger-plugin-jest to the repo #388

merged 1 commit into from
Oct 14, 2017

Conversation

orta
Copy link
Member

@orta orta commented Oct 9, 2017

Figured it was time we actually used this 馃憤

@DangerCI
Copy link

DangerCI commented Oct 9, 2017

Warnings
鈿狅笍

Please add a changelog entry for your changes.

New dependencies added: danger-plugin-jest and jest-json-reporter.

danger-plugin-jest

Author: Macklin Underdown

Description: Danger plugin for Jest

Homepage: https://github.com/macklinu/danger-plugin-jest#readme

Created5 months ago
Last Updated1 day ago
LicenseMIT
Maintainers1
Releases3
Direct Dependenciesstrip-ansi and serve
Keywordsdanger, danger-plugin and jest
README

danger-plugin-jest

Build Status
npm version
semantic-release
Greenkeeper badge

Danger plugin for Jest

Usage

Setup Jest

This Danger plugin relies on modifying your Jest configuration slightly on CI to also output a JSON file of the results.

You need to make the yarn jest command include: --outputFile test-results.json --json. This will run your tests
like normal, but will also create a file with the full test results after.

You may also want to add the JSON output file to your .gitignore, since it doesn't need to be checked into source control.

Setup Danger

Install this Danger plugin:

yarn add danger-plugin-jest --dev

By default, this package will assume you've set the filename as test-results.json, but you can use any path.

// dangerfile.js
import path from 'path'
import jest from 'danger-plugin-jest'

// Default
jest()
// Custom path
jest({ testResultsJsonPath: path.resolve(__dirname, 'tests/results.json') })

See src/index.ts for more details.

Changelog

See the GitHub release history.

Development

Install Yarn, and install the dependencies - yarn install.

Run the Jest test suite with yarn test.

This project uses semantic-release for automated NPM package publishing.

The main caveat: instead of running git commit, run yarn commit and follow the prompts to input a conventional changelog message via commitizen.

鉂わ笍

yarn why danger-plugin-jest output

  • Has been hoisted to "danger-plugin-jest"
  • This module exists because it's specified in "devDependencies".
  • Disk size without dependencies: "84kB"
  • Disk size with unique dependencies: "100kB"
  • Disk size with transitive dependencies: "116kB"
  • Number of shared dependencies: 2

Generated by 馃毇 dangerJS

@orta orta force-pushed the add_danger_jest branch 2 times, most recently from 98fee7a to 633db88 Compare October 9, 2017 13:44
@orta
Copy link
Member Author

orta commented Oct 9, 2017

waiting on macklinu/danger-plugin-jest#23

@orta orta merged commit a3bcb33 into master Oct 14, 2017
@orta orta deleted the add_danger_jest branch October 14, 2017 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants