Skip to content

Commit

Permalink
Add CHANGELOG and use jest-circus in unit tests as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Apr 26, 2021
1 parent c047e27 commit 4c79836
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Include a Jest Reporter that formats test results for GitHub Actions annotations ([#31041](https://github.com/WordPress/gutenberg/pull/31041)).
- Have the `format` command ignore files listed in a `.prettierignore` file, add a fallback `.prettierignore` to the package ([30844](https://github.com/WordPress/gutenberg/pull/30844)).
- The e2e tests are now using [`jest-circus`](https://github.com/facebook/jest/tree/master/packages/jest-circus) as the test runner. This enable us to capture screenshots at the time the tests failed. The unit tests are also using the same test runner for consistency ([#28449](https://github.com/WordPress/gutenberg/pull/28449), [#31178](https://github.com/WordPress/gutenberg/pull/31178)).

### Breaking Changes

Expand Down
4 changes: 2 additions & 2 deletions packages/scripts/config/jest-environment-puppeteer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ class PuppeteerEnvironment extends NodeEnvironment {
replacement: '-',
} );
await writeFile(
`${ ARTIFACTS_PATH }/${ fileName }-snapshot.html`,
path.join( ARTIFACTS_PATH, `${ fileName }-snapshot.html` ),
await this.global.page.content()
);
await this.global.page.screenshot( {
path: `${ ARTIFACTS_PATH }/${ fileName }.jpg`,
path: path.join( ARTIFACTS_PATH, `${ fileName }.jpg` ),
} );
}

Expand Down
1 change: 1 addition & 0 deletions packages/scripts/config/jest-unit.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const path = require( 'path' );
const { hasBabelConfig } = require( '../utils' );

const jestUnitConfig = {
testRunner: 'jest-circus/runner',
preset: '@wordpress/jest-preset-default',
reporters: [
'default',
Expand Down

0 comments on commit 4c79836

Please sign in to comment.